示例#1
0
        public void QualityShouldDecreaseByOne()
        {
            var item    = new HamaraBasketItem(10, 10, ItemType.Expiring);
            var checker = new QualityChecker();

            checker.UpdateQuality(item);

            Assert.AreEqual(9, item.Quality);
        }
示例#2
0
        public void QualityShouldDecreaseByOneWhenSellByIsZeroAndQualtiyIsOne()
        {
            var item    = new HamaraBasketItem(0, 1, ItemType.Expiring);
            var checker = new QualityChecker();

            checker.UpdateQuality(item);

            Assert.AreEqual(0, item.Quality);
        }
示例#3
0
        public void QualityShouldNotBeNegative()
        {
            var item    = new HamaraBasketItem(1, 0, ItemType.Expiring);
            var checker = new QualityChecker();

            checker.UpdateQuality(item);

            Assert.AreEqual(0, item.Quality);
        }
示例#4
0
        public void QualityShouldDecreaseTwiceWhenSellByPassed()
        {
            var item    = new HamaraBasketItem(0, 10, ItemType.Expiring);
            var checker = new QualityChecker();

            checker.UpdateQuality(item);

            Assert.AreEqual(8, item.Quality);
        }