I can\'t find an example of the usage of the When method in Moq
When(Func condition);
What is the purpose/usage of the method? Plea
With this method you can configure your mocked object's behavior when the condition set in Mock.When(...) evaluates to true. This enables your mocked object to react differently depending on the given condition.
Mock.When(...)