This question is locked. New answers and comments are not allowed.
Hello,
I got a question if it is possible to ask how many times a mock property has been set. What is got till now is this witch works but it aint the correct way to use I guess.
I thought that maybe the right way to use it is something like this
Because the Assert() method can be used like this
I hope someone knows the correct way to do this.
Thanks in advance,
Jeroen Speldekamp
I got a question if it is possible to ask how many times a mock property has been set. What is got till now is this witch works but it aint the correct way to use I guess.
int
nameCount = 0;
Mock.ArrangeSet(() => _mock.Name = Arg.AnyString).DoInstead(() => nameCount += 1).MustBeCalled();
I thought that maybe the right way to use it is something like this
Mock.AssertSet(() => { _mock.Name = Arg.AnyString; }, Occurs.Exactly(2));
Because the Assert() method can be used like this
Mock.Assert(() => _mock.ThisIsAMethod(Arg.AnyGuid), Occurs.Exactly(1));
I hope someone knows the correct way to do this.
Thanks in advance,
Jeroen Speldekamp