public void SetUp()
 {
     // This code simulate the return from the data base of a list of vehicles.
     _mockDataServices.Setup(x => x.GetVehicleDataServices().GetSummaryAllAsync()).ReturnsAsync(
         (() => new List <VehicleSummaryDto>()
     {
         new VehicleSummaryDto()
         {
             Code = "12920", Brand = "FIAT"
         },
         new VehicleSummaryDto()
         {
             Code = "12892", Brand = "FIAT"
         },
         new VehicleSummaryDto()
         {
             Code = "12282", Brand = "FIAT"
         },
         new VehicleSummaryDto()
         {
             Code = "12289", Brand = "FIAT"
         }
     }));
     _vehicleControlViewModel = new VehiclesControlViewModel(_mockConfigurationService.Object, _mockEventManager.Object, _mockDataServices.Object, _mockUnityContainer.Object, _mockRegionManager.Object);
     _mockEventManager.Setup(x => x.NotifyObserverSubsystem(MasterModuleConstants.VehiclesSystemName, currentPayload));
     _mockRegionManager.Setup(x => x.RequestNavigate("TabRegion", ""));
 }
示例#2
0
 public override ViewModelBase Initialize()
 {
     mViewModel = new VehiclesControlViewModel()
     {
         Vehicles = new ObservableCollection <Vehicle>(MainWindowController.serviceClient.GetVehicles())
     };
     return(mViewModel);
 }
 public void ExecuteVehiclesCommand(object obj)
 {
     vehiclesControlController                   = new VehiclesControlController();
     mViewModel.ActiveViewModel                  = vehiclesControlController.Initialize();
     vehiclesControlViewModel                    = (VehiclesControlViewModel)mViewModel.ActiveViewModel;
     mViewModel.ButtonsEnabled                   = true;
     mViewModel.VehiclesCurrentBackColor         = new SolidColorBrush(Colors.DodgerBlue);
     mViewModel.VehiclesCurrentForeColor         = new SolidColorBrush(Colors.White);
     mViewModel.CostMonthCurrentBackColor        = new SolidColorBrush(Colors.White);
     mViewModel.CostMonthCurrentForeColor        = new SolidColorBrush(Colors.Black);
     mViewModel.CostBusinessUnitCurrentBackColor = new SolidColorBrush(Colors.White);
     mViewModel.CostBusinessUnitCurrentForeColor = new SolidColorBrush(Colors.Black);
     mViewModel.StartCurrentBackColor            = new SolidColorBrush(Colors.White);
     mViewModel.StartCurrentForeColor            = new SolidColorBrush(Colors.Black);
     mViewModel.EmployeeCurrentBackColor         = new SolidColorBrush(Colors.White);
     mViewModel.EmployeeCurrentForeColor         = new SolidColorBrush(Colors.Black);
     mViewModel.BusinessUnitCurrentBackColor     = new SolidColorBrush(Colors.White);
     mViewModel.BusinessUnitCurrentForeColor     = new SolidColorBrush(Colors.Black);
     mViewModel.UserCurrentBackColor             = new SolidColorBrush(Colors.White);
     mViewModel.UserCurrentForeColor             = new SolidColorBrush(Colors.Black);
 }