verify structure #1666
Unanswered
WolfBullet
asked this question in
Q&A
Replies: 1 comment
-
|
Hello @WolfBullet, Can you post a code example to reproduce your problem? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My coding structure is, i have a base calss with several sub classes (ie:human ==> african, asian, european, american)
in my test enviremont i would like to be able to have the same strcuture, a base test calss that checks the method calls of the base class and sub test classes that specificly test the calls in the sub classes.
The issue is with Mock's you verify the total calls on a method. Meaning if a subcalss calls the same method the base class calls, the base class verify(x => x.dosomething, Times.Once) fails since it was now called twice. is there a way to test this sepratly? so moq looks oke you checked this method 2 times on a Times.Once. So the VerifyNoOtherCalls() sees it was called 2 times and checked twice with a times.once ==> also 2 times in total. unit test succeed.
if anything is unclear feell free to ask in the responses.
Beta Was this translation helpful? Give feedback.
All reactions