コード例 #1
0
        public void GetPrice_ReturnsPrice_Price()
        {
            //Arrange
            int     inputPrice  = 1000;
            BagItem testBagItem = new BagItem("Camera", inputPrice, 2, true);

            //Act
            int result = testBagItem.GetPrice();

            //Assert
            Assert.AreEqual(1000, result);
        }
コード例 #2
0
        public void SetPrice_UpdatePrice_UpdatedPrice()
        {
            //Arrange
            int     inputPrice  = 1000;
            BagItem testBagItem = new BagItem("Camera", inputPrice, 2, true);

            //Act
            int updatePrice = 500;

            testBagItem.SetPrice(updatePrice);
            int resultPrice = testBagItem.GetPrice();

            //Assert
            Assert.AreEqual(500, resultPrice);
        }