public void there_should_be_5_sellin_definitions()
        {
            var item = new Item();
            var definitions = item.GetType().Assembly.GetAllDerivedTypes<ISellByDefinition>();

            Assert.AreEqual(2, definitions.Count);
        }
Exemplo n.º 2
0
        public void it_should_increase_the_quality_of_brie()
        {
            // Arrange
            var item = new Item{ Name = ProductName.AgedBrie, Quality = 10, SellIn = 4 };

            // Act
            this.subject.Handle(item);

            // Assert
            Assert.AreEqual(11, item.Quality);
        }
Exemplo n.º 3
0
        public void it_should_decrease_the_quality_of_standard_items()
        {
            // Arrange
            var item = new Item { Name = ProductName.DexterityVest, Quality = 10, SellIn = 4 };

            // Act
            this.subject.Handle(item);

            // Assert
            Assert.AreEqual(9, item.Quality);
        }
Exemplo n.º 4
0
        public void should_handle_agedbrie_product()
        {
            // arrange
            var item = new Item
                           {
                               Name = ProductName.AgedBrie,
                               Quality = 10,
                               SellIn = 5
                           };

            // act
            var canHandle = this.subject.CanHandle(item.Name);

            // assert
            Assert.IsTrue(canHandle);
        }
Exemplo n.º 5
0
        public void should_increase_quality()
        {
            // arrange
            var item = new Item
            {
                Name = ProductName.AgedBrie,
                Quality = 10,
                SellIn = 5
            };

            // act
            var canHandle = this.subject.CanHandle(ProductName.AgedBrie);
            this.subject.UpdateQuality(item);

            // assert
            Assert.IsTrue(canHandle);

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