Exemplo n.º 1
0
 public LuggageController(IKeepingRepository repo, IHotelRepository hotelrepo, IMapper mapper, IUnitOfWork unitOfWork)
 {
     _hotelrepo  = hotelrepo;
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _repo       = repo;
 }
Exemplo n.º 2
0
 public HotelCategoryService(IRepositoryContext repositoryContext, IHotelRepository hotelRepository
                             , IHotelCategoryRepository hotelCategoryRepository)
 {
     this.repositoryContext       = repositoryContext;
     this.hotelRepository         = hotelRepository;
     this.hotelCategoryRepository = hotelCategoryRepository;
 }
Exemplo n.º 3
0
        public async Task GetListByMatchAsync_GetHotelListByMatchingNameAsync_ReturnsMatchingHotels(string name, string nonMatch, int matches)
        {
            // Set up sample data.
            var data = new List <Hotel>
            {
                new Hotel {
                    Id = 1, Name = $"{name}", Description = "Description2", Location = "Location2", Rating = Rating.Two
                },
                new Hotel {
                    Id = 2, Name = $"{name.ToUpper()}", Description = "Description1", Location = "Location1", Rating = Rating.Five
                },
                new Hotel {
                    Id = 3, Name = $"{name.ToLower()}", Description = "Description2", Location = "Location2", Rating = Rating.Three
                },
                new Hotel {
                    Id = 4, Name = $"{name} {nonMatch}", Description = "Description2", Location = "Location2", Rating = Rating.One
                },
                new Hotel {
                    Id = 5, Name = nonMatch, Description = "Description2", Location = "Location2", Rating = Rating.One
                },
            };

            // Initialise and assign the dataset.
            _hotelRepository = new HotelRepository(data);

            var result = await _hotelRepository.GetListByMatchAsync(name);

            // Cast to list to make assertions.
            var hotels = result.ToList();

            Assert.That(hotels, Is.TypeOf <List <Hotel> >());
            Assert.That(hotels.Count, Is.EqualTo(matches));
        }
Exemplo n.º 4
0
        public async Task GetListByRatingAsync_GetHotelListByRatingAsync_ReturnsMatchingHotels(Rating match, Rating nonMatch, int matches)
        {
            // Set up sample data.
            var data = new List <Hotel>
            {
                new Hotel {
                    Id = 1, Name = "Test", Description = "Description2", Location = "Location2", Rating = match
                },
                new Hotel {
                    Id = 2, Name = "Testing", Description = "Description1", Location = "Location1", Rating = match
                },
                new Hotel {
                    Id = 3, Name = "Example", Description = "Description2", Location = "Location2", Rating = match
                },
                new Hotel {
                    Id = 4, Name = "Mocks", Description = "Description2", Location = "Location2", Rating = match
                },
                new Hotel {
                    Id = 5, Name = "Units", Description = "Description2", Location = "Location2", Rating = nonMatch
                },
            };

            // Initialise and assign the dataset.
            _hotelRepository = new HotelRepository(data);

            var result = await _hotelRepository.GetListByRatingAsync(match);

            // Cast to list to make assertions.
            var hotels = result.ToList();

            Assert.That(hotels, Is.TypeOf <List <Hotel> >());
            Assert.That(hotels.Count, Is.EqualTo(matches));
        }
Exemplo n.º 5
0
 public RoomService(IRoomRepository roomRepository,
                    IHotelRepository hotelRepository, IUnitOfWork unitOfWork)
 {
     _RoomRepository  = roomRepository;
     _HotelRepository = hotelRepository;
     _UnitOfWork      = unitOfWork;
 }
Exemplo n.º 6
0
        public async Task GetAllAsync_GetAllHotelsAsync_ReturnsFiveHotels()
        {
            // Set up sample data.
            var data = new List <Hotel>
            {
                new Hotel {
                    Id = 1, Name = "Test", Description = "Description1", Location = "Location1", Rating = Rating.Five
                },
                new Hotel {
                    Id = 2, Name = "Testing", Description = "Description2", Location = "Location2", Rating = Rating.Three
                },
                new Hotel {
                    Id = 3, Name = "Example", Description = "Description2", Location = "Location2", Rating = Rating.Two
                },
                new Hotel {
                    Id = 4, Name = "Mocks", Description = "Description2", Location = "Location2", Rating = Rating.One
                },
                new Hotel {
                    Id = 5, Name = "Units", Description = "Description2", Location = "Location2", Rating = Rating.One
                },
            };

            // Initialise and assign the dataset.
            _hotelRepository = new HotelRepository(data);

            var result = await _hotelRepository.GetAllAsync();

            // Cast to list to make assertions.
            var hotels = result.ToList();

            Assert.That(hotels, Is.TypeOf <List <Hotel> >());
            Assert.That(hotels.Count, Is.EqualTo(5));
        }
Exemplo n.º 7
0
 public GetAllHotelsHandler(
     IHotelRepository hotelRepository,
     IMapper mapper)
 {
     _hotelRepository = hotelRepository;
     _mapper          = mapper;
 }
Exemplo n.º 8
0
 public AdminController(IHotelRepository repoH, IReservationRepository repoR, IReservationProcessor processor, IUsersRepository repoU)
 {
     repositoryH          = repoH;
     repositoryR          = repoR;
     reservationProcessor = processor;
     repositoryU          = repoU;
 }
Exemplo n.º 9
0
 public HotelsController(IHotelRepository hotelRepository, IMapper mapper, IOrderByFactory orderByFactory, ILogger <HotelsController> logger)
 {
     _hotelRepository = hotelRepository;
     _mapper          = mapper;
     _orderByFactory  = orderByFactory;
     _logger          = logger;
 }
Exemplo n.º 10
0
 public SearchHotelsHandler(
     IHotelRepository hotelRepository,
     IMapper mapper)
 {
     _hotelRepository = hotelRepository;
     _mapper          = mapper;
 }
Exemplo n.º 11
0
 public DebugController(IPopupService popupService, ICountryRepository countryRepository, ICongressVotingService congressVotingService,
                        ICongressVotingRepository congressVotingRepository, IBattleService battleService, IBattleRepository battleRepository,
                        ICompanyService companyService, IWalletService walletService, IMarketService marketService, IEquipmentService equipmentService,
                        ITransactionScopeProvider transactionScopeProvider, ICompanyRepository companyRepository, IEquipmentRepository equipmentRepository,
                        IHotelRepository hotelRepository, IMahService mahService, IHouseService houseService, IHouseRepository houseRepository,
                        HouseDayChangeProcessor houseDayChangeProcessor) : base(popupService)
 {
     this.countryRepository        = countryRepository;
     this.congressVotingService    = congressVotingService;
     this.congressVotingRepository = congressVotingRepository;
     this.battleService            = battleService;
     this.battleRepository         = battleRepository;
     this.companyService           = companyService;
     this.walletService            = walletService;
     this.marketService            = marketService;
     this.equipmentService         = equipmentService;
     this.transactionScopeProvider = transactionScopeProvider;
     this.companyRepository        = companyRepository;
     this.equipmentRepository      = equipmentRepository;
     this.hotelRepository          = hotelRepository;
     this.mahService              = mahService;
     this.houseService            = houseService;
     this.houseRepository         = houseRepository;
     this.houseDayChangeProcessor = houseDayChangeProcessor;
 }
Exemplo n.º 12
0
 public AccountController(SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager, IHotelRepository hotelRepository, IEmailService emailService)
 {
     _signInManager   = signInManager;
     _userManager     = userManager;
     _hotelRepository = hotelRepository;
     _emailService    = emailService;
 }
Exemplo n.º 13
0
 public CategoryController(IMenuRepository repo, IHotelRepository hotelrepo, IMapper mapper, IUnitOfWork unitOfWork)
 {
     _hotelrepo  = hotelrepo;
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _repo       = repo;
 }
Exemplo n.º 14
0
        public RegisterHotelDTOValidator(IHotelRepository hotelRepository,
                                         IHotelStatusRepository hotelStatusRepository,
                                         IHttpContextAccessor httpContextAccessor)
        {
            _hotelRepository       = hotelRepository;
            _hotelStatusRepository = hotelStatusRepository;
            _httpContextAccessor   = httpContextAccessor;

            RuleFor(x => x.Name).NotEmpty()
            .WithMessage("Hotel name is required.");

            RuleFor(x => x.Name).MinimumLength(2)
            .WithMessage("Username must have at least 2 characters.");

            RuleFor(x => x.Name).Must(DuplicateHotelName)
            .WithMessage("A hotel with that name already exists.");

            RuleFor(x => x.ContactNumber).NotEmpty()
            .WithMessage("Contact number is required.");

            RuleFor(x => x.Email).NotEmpty()
            .WithMessage("Email is required.");
            RuleFor(x => x.Email).EmailAddress()
            .WithMessage("Email must be in a correct format.");

            RuleFor(x => x.Address).NotEmpty()
            .WithMessage("Hotel address is required.");

            RuleFor(x => x.CityName).NotEmpty()
            .WithMessage("Specifying the city where the hotel is located is required.");

            RuleFor(x => x.StatusId).Must(StatusIdValidation)
            .WithMessage("Hotel status does not exist.");
        }
Exemplo n.º 15
0
 public NoteController(IBookingRepository repo, IHotelRepository hotelrepo, IMapper mapper, IUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _repo       = repo;
     _hotelrepo  = hotelrepo;
 }
Exemplo n.º 16
0
        public MainForm(IRoomRepository roomRepository, IHotelRepository hotelRepository)
        {
            InitializeComponent();

            this.roomRepository  = roomRepository;
            this.hotelRepository = hotelRepository;
        }
Exemplo n.º 17
0
 public HotelController(IHotelRepository repository, IHotelReservationService reservationService, SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager)
 {
     _repository         = repository;
     _reservationService = reservationService;
     _signInManager      = signInManager;
     _userManager        = userManager;
 }
 public GuestViewModel(IHotelRepository hotelRepository,
                       INotificationService notificationService) : this()
 {
     HotelRepository      = hotelRepository;
     NotificationService  = notificationService;
     GuestSearchViewModel = new GuestSearchViewModel(HotelRepository.Guests);
 }
Exemplo n.º 19
0
 public HotelService(IUnitOfWork unitOfWork,
                     IHotelRepository hotelRepository)
 {
     _language        = CultureInfo.CurrentCulture.Name;
     _unitOfWork      = unitOfWork;
     _hotelRepository = hotelRepository;
 }
Exemplo n.º 20
0
        public RecieptSearchViewModel(IHotelRepository hotelRepository)
        {
            HotelRepository = hotelRepository;

            UpdateRecieptsView();
            Messenger.Default.Register <UpdateReciptMessage>(this, x => UpdateRecieptsView());
            Messenger.Default.Register <UpdateBillMessage>(this, x => UpdateBillView());
        }
 public RoomViewModel(IHotelRepository hotelRepository, INotificationService notificationService) : this()
 {
     HotelRepository     = hotelRepository;
     NotificationService = notificationService;
     Messenger.Default.Register <UpdateRoomMessage>(this,
                                                    x => RoomSearchViewModel = new RoomSearchViewModel(typeof(Room), hotelRepository.Rooms));
     RoomSearchViewModel = new RoomSearchViewModel(typeof(Room), hotelRepository.Rooms);
 }
Exemplo n.º 22
0
        public RecieptViewModel(IHotelRepository hotelRepository,
                                INotificationService notificationService) : this()
        {
            HotelRepository = hotelRepository;

            NotificationService    = notificationService;
            RecieptSearchViewModel = new RecieptSearchViewModel(HotelRepository);
        }
Exemplo n.º 23
0
 public ReservationController(IBookingRepository repo, IMapper mapper, IHotelRepository hotelrepo,
                              IUnitOfWork unitOfWork, IHubContext <NotificationsHub> notifyHub)
 {
     _hotelrepo  = hotelrepo;
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _repo       = repo;
     _notifyHub  = notifyHub;
 }
Exemplo n.º 24
0
 public SearchController(IHotelRepository hotelRepo, IApplicationRepository sysRepo, IOwnerRepository ownerRepo, IContactPersonRepository contactRepo, IBranchRepository branchRepo, IStatusRepository statusRepo)
 {
     this.hotelRepo   = hotelRepo;
     this.sysRepo     = sysRepo;
     this.ownerRepo   = ownerRepo;
     this.contactRepo = contactRepo;
     this.branchRepo  = branchRepo;
     this.statusRepo  = statusRepo;
 }
Exemplo n.º 25
0
 public UnitOfWork(string connectionString)
 {
     _db             = new ApplicationContext(connectionString);
     UserManager     = new UserManager(new UserStore <User>(_db));
     RoleManager     = new RoleManager(new RoleStore <Role>(_db));
     ClientManager   = new ClientManager(_db);
     TourRepository  = new TourRepository(_db);
     HotelRepository = new HotelRepository(_db);
 }
Exemplo n.º 26
0
        private HotelAppService getSut_For_GetCheaperHotel_ShouldReturnCheaperHotel_WithinAGivenClient(Hotel cheaperHotel)
        {
            IHotelRepository mockedRepository =
                this.getHotelMockedRepo_For_GetCheaperHotel_ShouldReturnCheaperHotel_WithinAGivenClient(cheaperHotel);

            HotelAppService hotelAppService = new HotelAppService(mockedRepository);

            return(hotelAppService);
        }
Exemplo n.º 27
0
 public OrdersController(IMenuRepository repo, IHotelRepository hotelrepo,
                         IMapper mapper, IUnitOfWork unitOfWork, IHubContext <NotificationsHub> notifyHub)
 {
     _unitOfWork = unitOfWork;
     _notifyHub  = notifyHub;
     _mapper     = mapper;
     _repo       = repo;
     _hotelrepo  = hotelrepo;
 }
Exemplo n.º 28
0
 public CommentService(IUnitOfWork unitOfWork,
                       IMapper mapper,
                       IHotelRepository hotelRepository)
 {
     _unitOfWork        = unitOfWork;
     _mapper            = mapper;
     _hotelRepository   = hotelRepository;
     _commentRepository = _unitOfWork.GetRepository <Comment>();
 }
Exemplo n.º 29
0
 public TravelsController(UserManager <Employee> userManager, ITravelRepository travelRepository, IOfficeRepository officeRepository, IEmployeeRepository employeeRepository, IEmployeeTravelRepository employeeTravelRepository, IHotelRepository hotelRepository, ITransportRepository transportRepository)
 {
     _userManager              = userManager;
     _travelRepository         = travelRepository;
     _officeRepository         = officeRepository;
     _employeeRepository       = employeeRepository;
     _employeeTravelRepository = employeeTravelRepository;
     _hotelRepository          = hotelRepository;
     _transportRepository      = transportRepository;
 }
Exemplo n.º 30
0
 public RoomService(IUnitOfWork unitOfWork,
                    IMapper mapper,
                    IHotelRepository hotelRepository)
 {
     _language        = CultureInfo.CurrentCulture.Name;
     _unitOfWork      = unitOfWork;
     _mapper          = mapper;
     _hotelRepository = hotelRepository;
     _roomRepository  = _unitOfWork.GetRepository <Room>();
 }
Exemplo n.º 31
0
 public HotelService()
 {
     this._repository = new HotelRepository();
 }
Exemplo n.º 32
0
 public HotelController(IHotelRepository hotelRepository)
 {
     this.hotelRepository = hotelRepository;
 }
Exemplo n.º 33
0
 public HotelService(IObjectContext objectContext, IHotelRepository hotelRepository, IHistoryItemRepository historyItemRepository)
 {
     _objectContext = objectContext;
     _hotelRepository = hotelRepository;
     _historyItemRepository = historyItemRepository;
 }
Exemplo n.º 34
0
 /// <summary>
 /// Initialize the Service.
 /// </summary>
 public HotelService()
 {
     _hotelRepository = new HotelRepository();
 }
Exemplo n.º 35
0
 public HotelService(IHotelModelMapper hotelModelMapper, IHotelRepository hotelRepository)
 {
     _hotelModelMapper = hotelModelMapper;
     _hotelRepository = hotelRepository;
 }
Exemplo n.º 36
0
 public HotelController(IHotelRepository hotelRepository)
 {
     this.hotelRepository = hotelRepository;
     HotelMapper.CreateUserMapping();
 }
Exemplo n.º 37
0
 public HotelController(IHotelRepository hRepo)
 {
     hotelRepository = hRepo;
 }
Exemplo n.º 38
0
 public void Cleanup()
 {
     transactionScope.Dispose();
     hotelRepository = null;
 }
Exemplo n.º 39
0
 public void Setup()
 {
     transactionScope = new TransactionScope();
     hotelRepository = new HotelRepository();
 }