public void BeforeTest()
 {
     _hotelSystemDouble  = A.Fake <HotelSystem>();
     _stepFactoryDouble  = A.Fake <StepFactory>();
     _stepExecutorDouble = A.Fake <StepsExecutor>();
     _subject            = new ReserveHotelUsecase(_hotelSystemDouble, _stepFactoryDouble, _stepExecutorDouble);
 }
コード例 #2
0
        public void ShouldAddThreeHotelsToHotelsList()
        {
            var hotelSystem = new HotelSystem();

            new SystemInit().AddHotels(hotelSystem);
            hotelSystem.GetHotels().Should().HaveCount(3);
        }
コード例 #3
0
 public UseCaseFactory()
 {
     _hotelSystem  = new HotelSystem();
     _stepFactory  = new StepFactory();
     _stepExecutor = new StepsExecutor();
     _systemInit   = new SystemInit();
     _systemInit.AddHotels(_hotelSystem);
 }
コード例 #4
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var context = new HotelContext();

            IUserRepository        userRepository        = new UserRepository(context);
            IManagerRepository     managerRepository     = new ManagerRepository(context);
            IVisitorRepository     visitorRepository     = new VisitorRepository(context);
            IManagerInfoRepository managerInfoRepository = new ManagerInfoRepository(context);
            IVisitorInfoRepository visitorInfoRepository = new VisitorInfoRepository(context);
            IRoomRepository        roomRepository        = new RoomRepository(context);
            IBookingRepository     bookingRepository     = new BookingRepository(context);

            UserCollection        userCollection        = new UserCollection(userRepository);
            ManagerCollection     managerCollection     = new ManagerCollection(managerRepository);
            VisitorCollection     visitorCollection     = new VisitorCollection(visitorRepository);
            ManagerInfoCollection managerInfoCollection = new ManagerInfoCollection(managerInfoRepository);
            VisitorInfoCollection visitorInfoCollection = new VisitorInfoCollection(visitorInfoRepository);
            RoomCollection        roomCollection        = new RoomCollection(roomRepository);
            BookingCollection     bookingCollection     = new BookingCollection(bookingRepository);

            IHotelSystem hotel = new HotelSystem(userCollection, managerCollection, visitorCollection,
                                                 managerInfoCollection, visitorInfoCollection, roomCollection, bookingCollection);

            if (hotel.GetUser("root") is null)
            {
                hotel.AddUser(new Manager
                {
                    Login       = "******",
                    Password    = "******",
                    Salary      = 123,
                    ManagerInfo = new ManagerInfo {
                        Name = "lola", Surname = "brown", Email = "www@fw", StartDate = new DateTime(1999, 12, 12)
                    }
                });
            }

            Window mainWindow = new MainWindow();

            IDialogService dialogService = new DialogService.DialogService(mainWindow);

            dialogService.Register <RoomAboutDialogWindowModel, RoomAboutDialogWindow>();
            dialogService.Register <RoomBookingsDialogWindowModel, RoomBookingsDialogWindow>();
            dialogService.Register <AddBookingDialogWindowModel, AddBookingDialogWindow>();

            MainController mainController = new MainController(hotel, mainWindow, dialogService);

            mainController.LoadLoginDashboard();
        }
コード例 #5
0
 internal GetHotelsUseCase(HotelSystem hotelSystem)
 {
     _hotelSystem = hotelSystem;
 }
コード例 #6
0
 public void BeforeTest()
 {
     _subject = new HotelSystem();
 }
コード例 #7
0
 internal ReserveHotelUsecase(HotelSystem hotelSystem, StepFactory stepFactory, StepsExecutor stepExecutor)
 {
     _hotelSystem  = hotelSystem;
     _stepFactory  = stepFactory;
     _stepExecutor = stepExecutor;
 }
コード例 #8
0
 public void BeforeTest()
 {
     _hotelSystemDouble = A.Fake <HotelSystem>();
     _stepFactoryDouble = A.Fake <StepFactory>();
     _subject           = new GetHotelRequiredStepInputsUseCase(_hotelSystemDouble, _stepFactoryDouble);
 }
コード例 #9
0
 public void BeforeTest()
 {
     _hotelSystemDouble = A.Fake <HotelSystem>();
     _subject           = new GetHotelsUseCase(_hotelSystemDouble);
 }