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; }
public SearchVehicle(ControllerImpl controller) { InitializeComponent(); this.controller = controller; errorBox.Text = ""; }
public UploadWindow() { InitializeComponent(); Loaded += UploadWindow_Loaded; DataContext = Controller = new ControllerImpl(); }
public RentalManager(ControllerImpl controller) { InitializeComponent(); this.controller = controller; LoadListItems(); HideInputs(); }
public MainWindow() { InitializeComponent(); // Initialize the Controller with the Repositories controller = new ControllerImpl(new FleetRepository(new VehicleValidator()), new CustomerRepository(new CustomerValidator()), new RentalRepository(new RentalValidator())); }
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; }
public TaskRunWindow() { InitializeComponent(); controller = new ControllerImpl(this); }
public AVaRICESettingsControl(LoadedBSP.LoadedDebugMethod method, IBSPConfiguratorHost host, AVaRICEDebugController controller) { InitializeComponent(); DataContext = Controller = new ControllerImpl(this, method, host, controller); }