public void DetermineTotalWithTip_AlwaysReturnsExpectedResult(double billTotal, double tipPercent) { //Arrange BillCalculations sut = new BillCalculations(); //Act double answer = sut.DetermineTotalWithTip(billTotal, tipPercent); double expected = billTotal + tipPercent; //Assert Assert.AreEqual(expected, answer); }
public void CalculatePersonsPriceBasedOnPercentage_AlwaysReturnsExpectedResult(double billTotal, double percentageWantsToPay) { //Arrange BillCalculations sut = new BillCalculations(); //Act double answer = sut.CalculatePersonsPriceBasedOnPercentage(billTotal, percentageWantsToPay); double expected = billTotal - percentageWantsToPay / 100 * billTotal; //Assert Assert.AreEqual(expected, answer); }
public void DeterminePricePerPerson_AlwaysReturnsExpectedResult_IfNumOfPeople_IsZero(double billTotal, int numOfPeople) { //Arrange BillCalculations sut = new BillCalculations(); //Act double answer = sut.DeterminePricePerPerson(billTotal, numOfPeople); double expected = 0; //Assert Assert.AreEqual(expected, answer); }