-
-
Notifications
You must be signed in to change notification settings - Fork 820
Open
Description
Hi,
I've had a situation where I need to raise a signal once a certain number of calls are made on a mock that has void return value.
My setup is as such:
mock.SetupSequence(x => x.SendMessage(It.IsAny<Message>()))
.Throws(new SomeException())
.Throws(new SomeException())
.Throws(new SomeException())
.Pass(() => _tcs.SetResult()); // this does not compile
As it stands, the Pass
operation does not take any argument, so we can't inject a callback to occur when that step happens.
Is this something that can be added to the Pass
operation? Or would it be a new operation called Callback
?
If it is not worth it, is there another approach that can be taken that would be cleaner than using a counter + switch in a standard Setup + Callback ?
Metadata
Metadata
Assignees
Labels
No labels