public RequestController(IRoomTypeServices roomType, ICustomerRequestServices customerRequestServices, ICustomerRequestStatusService customerRequestStatusService) { _roomType = roomType; _customerRequestServices = customerRequestServices; _customerRequestStatusService = customerRequestStatusService; }
public void SetUp() { customerRequests = new List <CustomerRequest> { new CustomerRequest { Id = 0, DateFrom = DateTime.Now, DateTo = DateTime.Now, Sleeps = 1, RoomTypeId = 1, CustomerRequestStatusId = 1, HotelUserId = "0" }, new CustomerRequest { Id = 1, DateFrom = DateTime.Now, DateTo = DateTime.Now, Sleeps = 1, RoomTypeId = 1, CustomerRequestStatusId = 1, HotelUserId = "1" }, new CustomerRequest { Id = 2, DateFrom = DateTime.Now, DateTo = DateTime.Now, Sleeps = 3, RoomTypeId = 3, CustomerRequestStatusId = 3, HotelUserId = "3" }, new CustomerRequest { Id = 3, DateFrom = DateTime.Now, DateTo = DateTime.Now, Sleeps = 3, RoomTypeId = 3, CustomerRequestStatusId = 3, HotelUserId = "3" } }; // Create a new mock of the repository _customerRequestRepository = new Mock <IRepository <CustomerRequest> >(); _unitOfWork = new Mock <IUnitOfWork>(); // Set up the mock for the repository _unitOfWork.Setup(x => x.CustomerRequests.GetAll()).Returns(customerRequests); _customerRequestRepository.Setup(x => x.GetAll()) .Returns(customerRequests); // Create the service and inject the repository into the service _customerRequestService = new CustomerRequestService(_unitOfWork.Object); }
public ManageController(ICustomerRequestServices customerRequestServices, IRoomTypeServices roomTypeServices, ICustomerRequestStatusService customerRequestStatusService, IConfirmationService confirmationService, IRoomService roomService, IBookingService bookingService) { _customerRequestServices = customerRequestServices; _roomTypeServices = roomTypeServices; _customerRequestStatusService = customerRequestStatusService; _confirmationService = confirmationService; _roomService = roomService; _bookingService = bookingService; }