コード例 #1
0
        public void GetPrice_DiscountNotApplicable_ShouldReturnSum()
        {
            var watch            = new Watch("001", "Rolex", 100, new Discount(3, 200));
            var watchForPurchase = new WatchForPurchase(watch, 2);

            Assert.Equal(200, watchForPurchase.GetPrice());
        }
コード例 #2
0
        public void GetPrice_DiscountIsApplicablePlusOne_ShouldReturnCost()
        {
            var watch            = new Watch("001", "Rolex", 100, new Discount(3, 200));
            var watchForPurchase = new WatchForPurchase(watch, 4);

            Assert.Equal(300, watchForPurchase.GetPrice());
        }
コード例 #3
0
        public void GetPrice_NoDiscount_OneItem_ShouldReturnItemPrice()
        {
            var watch = new Watch("004", "Casio", 30);

            var watchForPurchase = new WatchForPurchase(watch, 1);

            Assert.Equal(30, watchForPurchase.GetPrice());
        }
コード例 #4
0
        public void GetPrice_NoDiscount_ThreeItems_ShouldReturnSum()
        {
            var watch = new Watch("004", "Casio", 30);

            var watchForPurchase = new WatchForPurchase(watch, 3);

            Assert.Equal(90, watchForPurchase.GetPrice());
        }