public void VisitBasketTotalReturnsCorrectResult( int rate, int amount) { var sut = new VatVisitor(rate, amount); var actual = sut.Visit(new BasketTotal(42)); var v = Assert.IsAssignableFrom <VatVisitor>(actual); Assert.Equal(rate, v.Rate); Assert.Equal(amount, v.Amount); }
public void VisitDiscountReturnsCorrectResult( int rate, int amount, int discountAmount) { var sut = new VatVisitor(rate, amount); var actual = sut.Visit(new Discount(discountAmount)); var v = Assert.IsAssignableFrom <VatVisitor>(actual); Assert.Equal(rate, v.Rate); Assert.Equal( amount - discountAmount * rate, v.Amount); }
public void VisitBasketItemReturnsCorrectResult( int rate, int amount, int unitPrice, int quantity) { var sut = new VatVisitor(rate, amount); var basketItem = new BasketItem("Dummy", unitPrice, quantity); var actual = sut.Visit(basketItem); var v = Assert.IsAssignableFrom <VatVisitor>(actual); Assert.Equal( amount + basketItem.Total * rate, v.Amount); Assert.Equal(rate, v.Rate); }