コード例 #1
0
 public void AccomodationFacilitiesEditId()
 {
     AccomodationFacilitiesController controller = new AccomodationFacilitiesController();
     var result = (HttpStatusCodeResult)controller.Edit((int?)null);
     Assert.AreEqual(400, result.StatusCode);
     Assert.IsInstanceOfType(result, typeof(HttpStatusCodeResult));
 }
コード例 #2
0
       public void AccomodationFacilitiesEdit()
       {
           AccomodationFacilitiesController controller = new AccomodationFacilitiesController();
      
           AccomodationFacility accfacility = new AccomodationFacility();
           accfacility.AccomodationFacilityId = 1;
           accfacility.AccomodationId = 1;
           accfacility.Description = "Testna Verzija";
           accfacility.EndHours = new DateTime(1999, 1, 1, 12, 0, 0);
           accfacility.StartHours = new DateTime(1999, 1, 1, 8, 0, 0);
           accfacility.Name = "Ime";
           var result = controller.Edit(accfacility);
           Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
 
           Assert.IsTrue(controller.ModelState.IsValid);
       }