コード例 #1
0
        public void CheckChargeReceiptCalculatesAfternoonCostCorrectly()
        {
            //Arrange
            ChargeReceipt receipt = new ChargeReceipt();
            Charge        charge1 = new Charge("PM", 2.5M, 180.0f);

            receipt.Add(charge1);
            Charge charge2 = new Charge("PM", 2.5M, 180.0f);

            receipt.Add(charge2);

            //Act
            var total = receipt.TotalAfternoonCost;

            //Assert
            Assert.AreEqual(total, "£15.00");
        }
コード例 #2
0
        public void CheckChargeReciptCalculatesGrandTotalCorrectly()
        {
            //Arrange
            ChargeReceipt receipt = new ChargeReceipt();
            Charge        charge1 = new Charge("AM", 2.0M, 180.0f);

            receipt.Add(charge1);
            Charge charge2 = new Charge("PM", 2.5M, 180.0f);

            receipt.Add(charge2);

            //Act
            var total = receipt.GrandTotal;

            //Assert
            Assert.AreEqual(total, "£13.50");
        }
コード例 #3
0
        public void CheckChargeReceiptCalculatesMorningCostCorrectly()
        {
            //Arrange
            ChargeReceipt receipt = new ChargeReceipt();
            Charge        charge1 = new Charge("AM", 2.0M, 180.0f);

            receipt.Add(charge1);
            Charge charge2 = new Charge("AM", 2.0M, 180.0f);

            receipt.Add(charge2);

            //Act
            var total = receipt.TotalMorningCost;

            //Assert
            Assert.AreEqual(total, "£12.00");
        }