public void Calculate_SalesTaxPercentage_ReturnCorrect(string county, double total, double expected) { var controller = new SalesTaxController(); var totalSalesTax = controller.SalesTax(county, total).CountySaleTaxPercentage; Assert.AreEqual(Math.Round(totalSalesTax, 2), expected); }
public void IsStatusSuccess() { var controller = new SalesTaxController(); var response = controller.Calculate("Yancey", 120); var s = getStatus(response); Assert.IsTrue(response.IsSuccessStatusCode, "Function was not Executed successfully"); Assert.AreEqual("SUCCESS", s, "Transaction should be successful since county exists"); }
public void IsStatusFail() { var controller = new SalesTaxController(); var response = controller.Calculate("Yance", 120); var s = getStatus(response); Assert.IsTrue(response.IsSuccessStatusCode, "Function was not Executed successfully"); Assert.AreEqual("FAIL", s, "Transaction should Fail since county does not exist"); }
public void SalesTaxExpectedResult_floatParameter() { var controller = new SalesTaxController(); var response = controller.Calculate("Yancey", (float)124.53); var s = getData(response); Assert.IsTrue(response.IsSuccessStatusCode, "Function was not Executed successfully"); Assert.AreEqual("$8.41", s, "Expected result not equal to actual result"); }
public static SalesTaxController Fixture() { SalesTaxController controller = new SalesTaxController(new SalesTaxRepository(), "", new LoginView()); return(controller); }
public static SalesTaxController Fixture() { SalesTaxController controller = new SalesTaxController(new SalesTaxRepository(), "", new LoginView()); return controller; }