// Create a mock repository var repository = new MockRepository(); // Create a mock object var mockObject = repository.CreateMock();
// Set expectations on the mock object mockObject.Expect(m => m.MethodName("parameter")).Return("returnValue");
// Verify the behavior of the mock object mockObject.VerifyAllExpectations();This example verifies that all expectations set on the mock object have been met. The Rhino.Mocks framework is open source and can be installed as a NuGet package.