public void AutomaticallCallBaseMethodIfNoExpectationWasSet() { Assert.Equal(1, abs.Increment()); Assert.Equal(6, abs.Add(5)); Assert.Equal(6, abs.Count); abs.VerifyAllExpectations(); }
public void CanClearOnlyOriginalMethodCalls() { MockRepository mocks = new MockRepository(); AbstractClass abstractClass = mocks.StrictMock <AbstractClass>(); Expect.Call(abstractClass.Add(0)).CallOriginalMethod(OriginalCallOptions.NoExpectation); mocks.BackToRecord(abstractClass, BackToRecordOptions.OriginalMethodsToCall); mocks.ReplayAll(); Assert.Throws <ExpectationViolationException>( "AbstractClass.Add(5); Expected #0, Actual #1.", () => abstractClass.Add(5)); }