public ActionResult Edit( [Bind(Include = "HealthOfficeId,Address,Email,Phone,Fax,PostalCode")] HealthOffice healthOffice) { if (ModelState.IsValid) { db.Entry(healthOffice).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(healthOffice)); }
public ActionResult Create( [Bind(Include = "HealthOfficeId,Address,Email,Phone,Fax,PostalCode")] HealthOffice healthOffice) { if (ModelState.IsValid) { db.HealthOffices.Add(healthOffice); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(healthOffice)); }
public void QueryHealthOffice_MultipleResults_ReturnsFirst() { var expectedHealthOffice = new HealthOffice { Address = "Landratsamt Forchheim\nGesundheitsamt\nAm Streckerplatz 3\n91301 Forchheim", Phone = "09191 86-3504", Fax = "09191 86-3508", Email = "*****@*****.**", PostalCode = "91301" }; var rkiTool = new RkiTool(s => RkiToolQueryMultipleResults); var healthOffice = rkiTool.QueryHealthOffice("91301"); healthOffice.Should().BeEquivalentTo(expectedHealthOffice); }
public void QueryHealthOffice_InvalidPhoneAndFax_RemovesExcessSpaces() { var expectedHealthOffice = new HealthOffice { Address = "Landratsamt Forchheim\nGesundheitsamt\nAm Streckerplatz 3\n91301 Forchheim", Phone = "09191 86-3504", Fax = "09191 86-3508", Email = "*****@*****.**", PostalCode = "91301" }; var rkiTool = new RkiTool(s => RkiToolQueryResultWithInvalidPhoneAndFax); var healthOffice = rkiTool.QueryHealthOffice("91301"); healthOffice.Should().BeEquivalentTo(expectedHealthOffice); }