Exemple #1
0
        public void GetPriceReturnsUnitMultipliedByUnitPrice(decimal unitPrice, int units)
        {
            //arrange
            //act
            var sut = new GoodItem(unitPrice, units, true, GoodItemTypeEnum.Book, null, new GoodItemDetails());

            //assert
            Assert.Equal(sut.GetUnitPrice() * sut.GetUnits(), sut.GetPrice());
        }
Exemple #2
0
        public void GetTotalPriceReturnsSumPriceSalesTax()
        {
            //arrange
            var sut = new GoodItem(24, 1, false, GoodItemTypeEnum.Other, null, new GoodItemDetails());
            var expectedTotalPrice = sut.GetSalesTax() + sut.GetPrice();

            //act
            var actualTotal = sut.GetTotalPrice();

            //assert
            Assert.True(expectedTotalPrice == actualTotal);
        }