public async Task <ActionResult <Residance> > PostResidance(Residance residance) { _context.residances.Add(residance); await _context.SaveChangesAsync(); return(CreatedAtAction("GetResidance", new { id = residance.Id }, residance)); }
public async Task <IActionResult> PutResidance(int id, Residance residance) { if (id != residance.Id) { return(BadRequest()); } _context.Entry(residance).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResidanceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Boundary_Testfor_ValidZipNumber() { //Action //Action var residance = new Residance() { QuoteId = "Q1", AddressLine1 = "Bangalore", City = "Bangalore", Zip = 675201 }; //Assert Assert.Equal(6, residance.Zip.ToString().Length); }
public void Test_For_Valid_ApplyQoute() { //Arrange Qoute ApplyQoute(Residance residance,Property property); var residance = new Residance() { QuoteId = "Q1", AddressLine1 = "Bangalore", City = "Bangalore", Zip = 675201 }; var property = new Property() { PropertyId = 12345, QouteId = "q1", UserId = 1234 }; //Action var getQoute = _service.ApplyQoute(residance, property); //Assert Assert.NotNull(getQoute); }
public Qoute ApplyQoute(Residance residance, Property property) { throw new NotImplementedException(); }