public void VisitVatReturnsCorrectResult( int initialTotal , int vatAmount) { var sut = new BasketTotalVisitor(initialTotal); var actual = sut.Visit(new Vat(vatAmount)); var btv = Assert.IsAssignableFrom <BasketTotalVisitor>(actual); Assert.Equal(initialTotal + vatAmount, btv.Total); }
public void VisitDiscountReturnsCorrectResult( int initialTotal, int discount) { var sut = new BasketTotalVisitor(initialTotal); var actual = sut.Visit(new Discount(discount)); var btv = Assert.IsAssignableFrom <BasketTotalVisitor>(actual); Assert.Equal(initialTotal - discount, btv.Total); }
public void VisitBasketTotalElementReturnsCorrectResult( int expected, int total) { var sut = new BasketTotalVisitor(expected); var actual = sut.Visit(new BasketTotal(total)); var btv = Assert.IsAssignableFrom <BasketTotalVisitor>(actual); Assert.Equal(expected, btv.Total); }
public void VisitProductBasketElementReturnsCorrectResult( int unitPrice, int quantity, int initialTotal) { var sut = new BasketTotalVisitor(initialTotal); var productElement = new BasketItem("Dummy name", unitPrice, quantity); var actual = sut.Visit(productElement); var btv = Assert.IsAssignableFrom <BasketTotalVisitor>(actual); Assert.Equal(productElement.Total + initialTotal, btv.Total); }