Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }