Mock Objects - smudge202/clean-living GitHub Wiki
Mock objects are used normally in testing to simulate dependencies of an object, allowing you to test a particular method or scenario without giving the test access to real objects or systems.
- Moq
- RhinoMocks
public void MyTest()
{
//Arrange
var mockBar = new Mock<IBar>();
var foo = new Foo(mockBar.Object);
//Act
foo.DoSomething();
//Assert
mockBar.Verify(x => x.DoSecretThing(), Times.Exactly(1));
}