Mid Testing

How do you verify that a method was called on a mock object?

mockService.Verify(s => s.Save(), Times.Once);

This asserts that Save() was called exactly once during the test.

More from C# Programming Tutorial

All questions for this course