public void CreateAppliedReservation_empty() { // Arrange var mockRepository = new Mock <IRepository <ReservationApplied> >(); mockRepository.Setup(mpr => mpr.Add((ReservationApplied)null)); var controller = new ReservationsAppliedController(mockRepository.Object, _restClient, _appiumService, Logger, _externalProcesses); // Act var result = controller.Create(null); // Assert var viewResult = Assert.IsType <BadRequestObjectResult>(result); Assert.Equal("Reservation is empty.", viewResult.Value); }
public void CreateAppliedReservation() { // Arrange var mockRepository = new Mock <IRepository <ReservationApplied> >(); mockRepository.Setup(mpr => mpr.Add(_reservationApplied1)); var controller = new ReservationsAppliedController(mockRepository.Object, _restClient, _appiumService, Logger, _externalProcesses); // Act var result = controller.Create(_reservationApplied1); // Assert var viewResult = Assert.IsType <CreatedAtRouteResult>(result); Assert.Equal(_reservationApplied1, viewResult.Value); }