public void AddingTwiceAfterEnterWasPressed() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(1.0); sut.Enter(); sut.Pressed(2.0); sut.Enter(); sut.Add(); sut.Add(); displayMock.Received(1).Show(4.0); displayMock.Received(1).Show(5.0); }
public void AddThreeNumbers() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(1.0); sut.Enter(); sut.Pressed(2.0); sut.Add(); sut.Pressed(4.0); sut.Add(); displayMock.Received(2).Show(1.0); displayMock.Received(1).Show(2.0); displayMock.Received(1).Show(3.0); displayMock.Received(1).Show(4.0); displayMock.Received(1).Show(7.0); }
public void AddOneNumberWithoutEnter() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(1.0); sut.Add(); displayMock.Received(2).Show(1.0); }
public void IntegrationTestAddingSubtractingAndMultiplying() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(1); sut.Enter(); sut.Pressed(2); sut.Add(); sut.Pressed(4); sut.Enter(); sut.Pressed(1); sut.Subtract(); sut.Multiply(); displayMock.Received(3).Show(1.0); displayMock.Received(1).Show(2.0); displayMock.Received(2).Show(3.0); displayMock.Received(2).Show(4.0); displayMock.Received(1).Show(9.0); }