public void amountInTest() { PropertyTax taxTest = new PropertyTax(); int result = taxTest.amountIn = 5; Assert.AreEqual(5, result); }
public void nameTest() { PropertyTax taxTest = new PropertyTax(); string result = taxTest.name = "Tom"; Assert.AreEqual("Tom", result); }
public void CalculateTest() { PropertyTax taxTest = new PropertyTax(); taxTest.amountIn = 425000; double result = taxTest.Calculate; Assert.AreEqual(765, result); }
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); }
public ActionResult Calculate(PropertyTax Ca) { if (ModelState.IsValid) { return(RedirectToAction("Confirm", Ca)); } else { return(View(Ca)); } }
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)); } }
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)); } }
public ActionResult Confirm(PropertyTax Ca) { return(View(Ca)); }