Esempio n. 1
0
        public void ApplyTwoInOneAndOneEuroless_WhenThereAreTwoOrMuchVouchersAndThreeOrMoreTshirts()
        {
            this.shoppingBasketDtoMock.Setup(s => s.Products).Returns(TestsServices.CreateListWithThreeVouchersAndThreeTshirts());

            ShoppingBasketService sut = new ShoppingBasketService(shoppingBasketDtoMock.Object, mapperServiceMock.Object, efDbSetWrapper.Object, efDbContextSaveChanges.Object);

            //act
            var result = sut.GetTotalPrice() - sut.ApplyDiscountVoucher() - sut.ApplyDiscountTshirt();

            //assert
            Assert.AreEqual(74.5, result);
        }
Esempio n. 2
0
        public void NotApplyOneEuroLess_WhenThereAreLessOfThreeTshirts()
        {
            //arrange
            shoppingBasketDtoMock.Setup(s => s.Products).Returns(TestsServices.CreateListWithTwoTshirts());

            ShoppingBasketService sut = new ShoppingBasketService(shoppingBasketDtoMock.Object, mapperServiceMock.Object, efDbSetWrapper.Object, efDbContextSaveChanges.Object);

            //act
            var result = sut.GetTotalPrice() - sut.ApplyDiscountVoucher() - sut.ApplyDiscountTshirt();

            //assert
            Assert.AreEqual(57.5, result);
        }