public void SettingExpectationOnNonVirtualOverloadOfVirtualMethodThrowsArgumentException() { Mock <SampleClassWithVirtualAndNonVirtualMethods> mock = Mocks.CreateMock <SampleClassWithVirtualAndNonVirtualMethods>(); Expect.That(() => mock.Expects.One.MethodWith(_ => _.Add(1, 2, 3)).WillReturn(10)).Throws <ArgumentException>(); Mocks.ClearExpectations(); }
public void TearDown() { // We're mucking around with changing the default IMockObjectFactory in some tests // in this fixture. Here we restore things back to normal after each test. Mocks.ClearExpectations(); //.ChangeDefaultMockObjectFactory(typeof (CastleMockObjectFactory)); }