public void Should_ExecutePrintResultMethodWithArgument6OfOutputService_WhenDoing2Multiply3() { //arrange var clientMock = new Mock<IOutputService>(); var calculator = new CalculatorEngine(clientMock.Object); calculator.FirstArg = 2; calculator.SecondArg = 3; string expected = "6,00000"; //act calculator.Multiply(); //Assert clientMock.Verify(x => x.PrintData(expected), Times.Exactly(1)); }
public void Should_Return2Point6_WhenDoing2Multiply1Point3() { //arrange var clientMock = new Mock<IOutputService>(); var calculator = new CalculatorEngine(clientMock.Object); calculator.FirstArg = 2.0; calculator.SecondArg = 1.3; string expected = "2,60000"; //act calculator.Multiply(); //asssert Assert.AreEqual(calculator.Result, expected); }