コード例 #1
0
 public void RoomsCreate()
 {
     RoomsController controller = new RoomsController();
     Room rm = new Room();
     rm.AccomodationId = 1;
     rm.NumberOfRooms = 23;
     rm.Price = 50;
     rm.TempReservationString = "reserved";
     rm.RoomCapacity = 2;
     rm.RoomId = 0;  
     rm.RoomTypeId = 1;
     rm.RoomDetails = " Air conditioning, Desk, Heating, Shower, Hairdryer,Flat-screen TV, Wi-Fi,Pay-per-view channels,Minibar";
     var result = controller.Create(rm);
     Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
    
 }
コード例 #2
0
 public void CreateValidate()
 {
     RoomsController controller = new RoomsController();
     var result = controller.Create() as ViewResult;
     var newResult = controller.Create();
     Assert.IsInstanceOfType(newResult, typeof(ViewResult));
 }