コード例 #1
0
        public void ShouldDecreaseSellInTimeAfterEachUpdate()
        {
            // arrange
            var sellIn  = 10;
            var quality = 20;

            var item = new DegradingItem("item", sellIn, quality);

            // act
            item.Update();

            // assert
            Assert.Equal(sellIn - 1, item.SellIn);
        }
コード例 #2
0
        public void ShouldDegradeItemQualityTwiceAsFastAfterSellIn()
        {
            // arrange
            var sellIn  = 0;
            var quality = 20;

            var item = new DegradingItem("item", sellIn, quality);

            // act
            item.Update();

            // assert
            Assert.Equal(quality - 2, item.Quality);
        }
コード例 #3
0
        public void ShouldNotDegradeQualityBelowZero()
        {
            // arrange
            var sellIn  = 10;
            var quality = 0;

            var item = new DegradingItem("item", sellIn, quality);

            // act
            item.Update();

            // assert
            Assert.Equal(quality, item.Quality);
        }
コード例 #4
0
        public void ShouldDegradeItemQualityAfterEachUpdate()
        {
            // arrange
            var sellIn  = 10;
            var quality = 20;

            var item = new DegradingItem("item", sellIn, quality);

            // act
            item.Update();

            // assert
            Assert.Equal(quality - 1, item.Quality);
        }