Example #1
0
        public void TestCase_Nine_AfterOneDay_InvalidItem()
        {
            InventoryItem itemInput = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.NotValid,
                Item_SellDays     = -1,
                Item_QualityValue = 5
            };

            InventoryItem itemOutputExpected = new InventoryItem()
            {
                ErrorMessage = "NO SUCH ITEM",
                ErrorOccured = true
            };

            InventoryItem updateItemResult = UpdateInventoryItem.Update_InventoryItem(itemInput, oneDay);

            // Assert expected values with output values
            Assert.AreEqual(itemOutputExpected.ErrorMessage, updateItemResult.ErrorMessage);
            Assert.AreEqual(itemOutputExpected.ErrorOccured, updateItemResult.ErrorOccured);
        }
Example #2
0
        public void TestCase_Four_AfterOneDay_ChristmasCrackers()
        {
            InventoryItem itemInput = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.ChristmasCrackers,
                Item_SellDays     = -1,
                Item_QualityValue = 2
            };

            InventoryItem itemOutputExpected = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.ChristmasCrackers,
                Item_SellDays     = -2,
                Item_QualityValue = 0
            };

            InventoryItem updateItemResult = UpdateInventoryItem.Update_InventoryItem(itemInput, oneDay);

            // Assert expected values with output values
            Assert.AreEqual(itemOutputExpected.Item_QualityValue, updateItemResult.Item_QualityValue);
            Assert.AreEqual(itemOutputExpected.Item_SellDays, updateItemResult.Item_SellDays);
        }
Example #3
0
        public void TestCase_Three_AfterOneDay_AgedBrie()
        {
            InventoryItem itemInput = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.AgedBrie,
                Item_SellDays     = 1,
                Item_QualityValue = 1
            };

            InventoryItem itemOutputExpected = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.AgedBrie,
                Item_SellDays     = 0,
                Item_QualityValue = 2
            };

            InventoryItem updateItemResult = UpdateInventoryItem.Update_InventoryItem(itemInput, oneDay);

            // Assert expected values with output values
            Assert.AreEqual(itemOutputExpected.Item_QualityValue, updateItemResult.Item_QualityValue);
            Assert.AreEqual(itemOutputExpected.Item_SellDays, updateItemResult.Item_SellDays);
        }
Example #4
0
        public void TestCase_Two_AfterOneDay_FrozenItem()
        {
            InventoryItem itemInput = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.FrozenItem,
                Item_SellDays     = -1,
                Item_QualityValue = 55
            };

            InventoryItem itemOutputExpected = new InventoryItem()
            {
                Item_Type         = ItemTypeEnum.FrozenItem,
                Item_SellDays     = -2,
                Item_QualityValue = 50
            };

            InventoryItem updateItemResult = UpdateInventoryItem.Update_InventoryItem(itemInput, oneDay);

            // Assert expected values with output values
            Assert.AreEqual(itemOutputExpected.Item_QualityValue, updateItemResult.Item_QualityValue);
            Assert.AreEqual(itemOutputExpected.Item_SellDays, updateItemResult.Item_SellDays);
        }