var mock = MockRepository.GenerateMock(); mock.SomeMethod(); mock.Verify(x => x.SomeMethod(), Times.Once());
var mock = MockRepository.GenerateStrictMockIn this example, a strict mock object is created for the IMyInterface interface and an expectation is set that the SomeMethod method will return the integer value 42. The SomeMethod method is called on the mock object and the VerifyAllExpectations method is used to ensure that the expectation was met. The Rhino.Mocks library is available as a NuGet package.(); mock.Expect(x => x.SomeMethod()).Return(42); var result = mock.SomeMethod(); mock.VerifyAllExpectations();