public void MultiplyThreeNumbers() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(3.0); sut.Enter(); sut.Pressed(2.0); sut.Multiply(); sut.Pressed(5.0); sut.Multiply(); displayMock.Received(2).Show(3.0); displayMock.Received(1).Show(2.0); displayMock.Received(1).Show(6.0); displayMock.Received(1).Show(5.0); displayMock.Received(1).Show(30.0); }
public void MultiplyingTwiceAfterEnterWasPressed() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(3.0); sut.Enter(); sut.Pressed(2.0); sut.Enter(); sut.Multiply(); sut.Multiply(); displayMock.Received(1).Show(4.0); displayMock.Received(1).Show(12.0); }
public void MultiplyOneNumberWithoutEnter() { var displayMock = Substitute.For<Display>(); var sut = new RpnCalc(displayMock); sut.Pressed(1.0); sut.Multiply(); displayMock.Received(1).Show(1.0); displayMock.Received(1).Show(0.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); }