Пример #1
0
        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();
        }
Пример #2
0
 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));
 }