chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
as usual, I am using MSTEST that call fake private method

myAccessor target = new myAccessor()

           using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                dtMax = target.InUTCTime(dtMax, 1, 1, 1);
                recorder.Return(new DateTime(1999, 10, 1, 19, 18, 02));
            }

           using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                dtMax = target.InUTCTime1(dtMax, 1, 1, 1);
                recorder.Return(new DateTime(1999, 10, 1, 19, 18, 02));
            }



In one of the test cases, both methods will be called, in another case, only 1 method will be called. I want to asset something like fake.verify.notcalled. How do I do that?
asked by ben1628 (2k points)

13 Answers

0 votes
I do agree not to over unit testing the app. I'm not suggesting we unit test every single private method. However, I do see the need to test the most critical one to make sure they're working...

Without support of out/ref for the private method, one has to use private accessor, and without all those benefits of finding out whether a call is made.
answered by ben1628 (2k points)
0 votes
does isolator 2010 solves this problem?
answered by ben1628 (2k points)
0 votes
We didn't add this feature to Isolator yet - so no
answered by dhelper (11.9k points)
...