Exemplo n.º 1
0
        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");
        }
Exemplo n.º 5
0
        public static SalesTaxController Fixture()
        {
            SalesTaxController controller = new SalesTaxController(new SalesTaxRepository(), "", new LoginView());

            return(controller);
        }
Exemplo n.º 6
0
 public static SalesTaxController Fixture()
 {
     SalesTaxController controller = new SalesTaxController(new SalesTaxRepository(), "", new LoginView());
     return controller;
 }