I'm using Moq library. I'm mocking up an instance that does all regular CRUD functionality. I would like to set it up in a way to allow only one Delete(x) call over some object and all consecutive calls to Delete(x) of the same object should return an Exception.
My Delete() method returns void.
How do I do that?
Some code
mock = new Mock<ITest>();
mock.Setup(m => m.Delete(1));
mock.Setup(m => m.Delete(3)).Throws<Exception>();
...