Пример #1
0
        public void SellAccomodationShouldInformUserWhenAccomodationIsAlreadySold()
        {
            //Init
            var clientModel = new SellAccomodationModel
            {
                AccomodationNumber = AccomodationTest.GetAccomodation().Number,
                PersonId           = "1"
            };

            var person              = PersonTest.GetPersonWithoutId();
            var accomodation        = AccomodationTest.GetAccomodation();
            var personService       = Substitute.For <PersonService>();
            var clientService       = Substitute.For <ClientService>();
            var prospectService     = Substitute.For <ProspectService>();
            var accomodationService = Substitute.For <AccomodationService>();
            var personQuery         = Substitute.For <PersonQueryExtended>();
            var accomodationQuery   = Substitute.For <AccomodationQueryExtended>();
            var controller          = new ControllerImpl(personService, clientService, prospectService,
                                                         accomodationService, personQuery, accomodationQuery);

            clientService
            .When(c => c.SellAccomodation(person, accomodation))
            .Do(c => { throw new AccomodationAlreadySoldException(); });

            //Act
            var message = controller.SellAccomodation(clientModel);

            //Assert
            Check.That(message).IsEqualTo("Accomodation Sold !");
        }
 internal DerivedSetting(ControllerImpl controller, string key, RedLinkServerCommandLine.SettingMode mode, params string[] choices)
 {
     _Key        = key;
     _Mode       = mode;
     _Defaults   = choices;
     _Controller = controller;
 }
Пример #3
0
        public SearchVehicle(ControllerImpl controller)
        {
            InitializeComponent();

            this.controller = controller;
            errorBox.Text   = "";
        }
Пример #4
0
        public UploadWindow()
        {
            InitializeComponent();
            Loaded += UploadWindow_Loaded;

            DataContext = Controller = new ControllerImpl();
        }
        public RentalManager(ControllerImpl controller)
        {
            InitializeComponent();
            this.controller = controller;

            LoadListItems();
            HideInputs();
        }
Пример #6
0
        public MainWindow()
        {
            InitializeComponent();

            // Initialize the Controller with the Repositories
            controller = new ControllerImpl(new FleetRepository(new VehicleValidator()),
                                            new CustomerRepository(new CustomerValidator()), new RentalRepository(new RentalValidator()));
        }
Пример #7
0
        public FleetManager(ControllerImpl controller)
        {
            InitializeComponent();
            this.controller = controller;

            LoadListItems();
            HideInputs();
            LoadComboBoxes();
        }
        internal RedLinkSettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, RedLinkDebugController debugController)
        {
            host.InstallStyles(this);

            Controller = new ControllerImpl(method, host, debugController, this);
            InitializeComponent();

            host.MakeSearchableComboBox(DeviceComboBox, (i, f) => Controller.FilterItem(i, f), Resources["deviceScriptSelectionControl"]);

            _ServerCheckTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Normal, (s, e) => Controller.UpdateServerStatus(), Dispatcher)
            {
                IsEnabled = false
            };
            Loaded           += (s, e) => _ServerCheckTimer.IsEnabled = true;
            Unloaded         += (s, e) => _ServerCheckTimer.IsEnabled = false;
            IsVisibleChanged += (s, e) => _ServerCheckTimer.IsEnabled = IsVisible;
        }
Пример #9
0
 public TaskRunWindow()
 {
     InitializeComponent();
     controller = new ControllerImpl(this);
 }
Пример #10
0
 public AVaRICESettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, AVaRICEDebugController controller)
 {
     InitializeComponent();
     DataContext = Controller = new ControllerImpl(this, method, host, controller);
 }