Пример #1
0
 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));
 }
Пример #2
0
        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));
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }