public void Test_Calculate_Tax_50000()
        {
            // 133510
            var result = _taxCalculator.Calculate(_taxRate, 50000m);

            Assert.AreEqual(11000M, result.TotalAmount);
        }
        public void Test_Calculate_Flat_Rate_Tax_15000()
        {
            // ARRANGE
            var income = 15000m;

            //ASSERT
            Assert.AreEqual(_taxCalculator.Calculate(taxRate, income).TotalAmount, 1200m);
        }
예제 #3
0
        public IActionResult CalculateTax([FromBody] TaxRequestDto taxRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var taxResponse = _taxCalculatorService.Calculate(taxRequest);

            return(Ok(taxResponse));
        }
예제 #4
0
 public IActionResult CalculateIncomeTax(string countryCode, decimal annualIncome)
 {
     return(Ok(_taxCalculatorService.Calculate(countryCode, annualIncome)));
 }