예제 #1
0
        public void amountInTest()
        {
            PropertyTax taxTest = new PropertyTax();
            int         result  = taxTest.amountIn = 5;

            Assert.AreEqual(5, result);
        }
예제 #2
0
        public void nameTest()
        {
            PropertyTax taxTest = new PropertyTax();
            string      result  = taxTest.name = "Tom";

            Assert.AreEqual("Tom", result);
        }
예제 #3
0
        public void CalculateTest()
        {
            PropertyTax taxTest = new PropertyTax();

            taxTest.amountIn = 425000;
            double result = taxTest.Calculate;

            Assert.AreEqual(765, result);
        }
예제 #4
0
        public void PropertyValueBandTest()
        {
            PropertyTax taxTest = new PropertyTax();

            taxTest.amountIn = 70000;
            string result = taxTest.PropertyValueBand;

            Assert.AreEqual("Between 0 and 100,000", result);
        }
        public void Confirm(PropertyTax pt)
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.Confirm(pt) as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
예제 #6
0
 public ActionResult Calculate(PropertyTax Ca)
 {
     if (ModelState.IsValid)
     {
         return(RedirectToAction("Confirm", Ca));
     }
     else
     {
         return(View(Ca));
     }
 }
예제 #7
0
 public HttpResponseMessage PostPropertyTaxes(PropertyTax propertytax)
 {
     try {
         entities.PropertyTaxes.Add(propertytax);
         entities.SaveChanges();
         var message = Request.CreateResponse(HttpStatusCode.Created, propertytax);
         return(message);
     }catch (Exception ex) {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
예제 #8
0
 public HttpResponseMessage PutPropertyTaxes(int id, [FromBody] PropertyTax propertytax)
 {
     try {
         var entity = entities.PropertyTaxes.FirstOrDefault(x => x.PropertyID == id);
         if (entity == null)
         {
             return(Request.CreateErrorResponse(HttpStatusCode.NotFound, id.ToString()));
         }
         else
         {
             entity.AssetName = propertytax.AssetName;
             entity.TaxDate   = propertytax.TaxDate;
             entity.TaxAmount = propertytax.TaxAmount;
             entity.Status    = propertytax.Status;
             entity.Remarks   = propertytax.Remarks;
             entities.SaveChanges();
             return(Request.CreateResponse(HttpStatusCode.OK, entity));
         }
     } catch (Exception ex) {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
예제 #9
0
 public ActionResult Confirm(PropertyTax Ca)
 {
     return(View(Ca));
 }