コード例 #1
0
        public void TestDiscount()
        {
            terminal.SetPricing('A', 1.00, Tuple.Create(3, 3.0));
            terminal.ScanProduct('A');
            terminal.ApplyDiscount(0.2);

            var expectedTotal = 0.8;
            var actualTotal   = terminal.CalculateTotal();

            Assert.AreEqual(expectedTotal, actualTotal, delta: expectedTotal / 100);
        }