public ActionResult <decimal> GetExcludedAmount(decimal totalAmount) { var vatCalculator = new VatCalculator(); var vatRate = taxRepo.getVatRate(); return(vatCalculator.excludeVat(totalAmount, vatRate)); }
public void Test_CalculateExcludeVat(decimal totalAmount, decimal vatRate, decimal expectedAmount) { // Act var vatCalculator = new VatCalculator(); decimal actualAmount = vatCalculator.excludeVat(totalAmount, vatRate); // Assert Assert.True(expectedAmount == actualAmount, $"expected {expectedAmount}, actual {actualAmount}"); }