コード例 #1
0
 public void RoomTypesCreate()
 {
     RoomTypesController controller = new RoomTypesController();
     RoomType rt = new RoomType();
     rt.RoomTypeId = 0;
     rt.RoomTypeName="Deluxe";
     var result = controller.Create(rt);
     Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
 }
コード例 #2
0
        public void RoomTypeEdit()
        {

             RoomTypesController controller = new RoomTypesController();
             RoomType rt = new RoomType();

             rt.RoomTypeId = 1;
             rt.RoomTypeName = "Premier Room with One King Bed ";
             var result = controller.Edit(rt);
             Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
             Assert.IsTrue(controller.ModelState.IsValid);
       

        }