protected override void AdditionalSetup() { _mockUserInteraction = new Mock <ICustomUserInteraction>(); _mockUserInteraction.ConfirmReturnsFalseIfTitleStartsWith("Last Used Vehicle"); Ioc.RegisterSingleton <ICustomUserInteraction>(_mockUserInteraction.Object); _mockUserInteraction = new Mock <ICustomUserInteraction>(); Ioc.RegisterSingleton <ICustomUserInteraction>(_mockUserInteraction.Object); _fixture = new Fixture().Customize(new AutoMoqCustomization()); _fixture.Register <IReachability>(() => Mock.Of <IReachability>(r => r.IsConnected() == true)); _driver = new Core.Models.Driver() { LastName = "TestName", ID = new Guid() }; _vehicle = new Core.Models.Vehicle() { Registration = "TestRegistration", ID = new Guid() }; _infoService = _fixture.Create <InfoService>(); _infoService.CurrentDriverID = _driver.ID; _fixture.Inject <IInfoService>(_infoService); _currentDriverRepository = new Mock <ICurrentDriverRepository>(); _currentDriverRepository.Setup(cdr => cdr.GetByIDAsync(It.IsAny <Guid>())).ReturnsAsync(new CurrentDriver()); _fixture.Inject <ICurrentDriverRepository>(_currentDriverRepository.Object); }
protected override void AdditionalSetup() { var mockDispatcher = new MockDispatcher(); Ioc.RegisterSingleton <IMvxViewDispatcher>(mockDispatcher); Ioc.RegisterSingleton <IMvxMainThreadDispatcher>(mockDispatcher); var mockUserInteraction = new Mock <ICustomUserInteraction>(); Ioc.RegisterSingleton <ICustomUserInteraction>(mockUserInteraction.Object); _fixture = new Fixture().Customize(new AutoMoqCustomization()); _driver = new Core.Models.Driver() { LastName = "TestName", ID = new Guid() }; _infoService = _fixture.Create <InfoService>(); _fixture.Inject <IInfoService>(_infoService); var mockAuthenticationService = new Mock <IAuthenticationService>(); mockAuthenticationService.Setup(m => m.AuthenticateAsync(It.IsAny <string>())).ReturnsAsync(new AuthenticationResult { Success = false }); mockAuthenticationService.Setup(m => m.AuthenticateAsync(It.Is <string>(s => s == "9999"))).ReturnsAsync(new AuthenticationResult { Success = true, Driver = _driver }); _fixture.Inject <IAuthenticationService>(mockAuthenticationService.Object); _mockApplicationProfile = _fixture.InjectNewMock <IApplicationProfileRepository>(); _mockApplicationProfile.Setup(map => map.GetAsync()).ReturnsAsync(_fixture.Create <ApplicationProfile>()); _fixture.Inject <IRepositories>(_fixture.Create <Repositories>()); }
/// <summary> /// Initializes a new instance of the <see cref="CommonServices" /> class. /// </summary> /// <param name="busyService">The busy indicator service.</param> /// <param name="messageService">The messaging service</param> /// <param name="languageService">The language service.</param> /// <param name="telemetryService">The telemetry service.</param> /// <param name="dialogService">The dialog service.</param> /// <param name="navigationService">The navigation service.</param> /// <param name="fileService">The file service.</param> /// <param name="infoService">The information service.</param> /// <param name="converterService">The converter service.</param> /// <param name="dispatcherService">The dispatcher service.</param> /// <param name="authenticationService">The authentication service.</param> public CommonServices( IBusyService busyService, IMessageService messageService, ILanguageService languageService, ITelemetryService telemetryService, IDialogService dialogService, INavigationService navigationService, IFileService fileService, IInfoService infoService, IConverterService converterService, IDispatcherService dispatcherService, IAuthenticationService authenticationService) : base(busyService, messageService, languageService, telemetryService, dialogService, navigationService, infoService, converterService, dispatcherService) { AuthenticationService = authenticationService; FileService = fileService; }
public SigaaController(ILoginService loginService, IInfoService infoService, IReportGradesService gradesService, IVirtualClassService virtualClassService) { _loginService = loginService; _infoService = infoService; _gradesService = gradesService; _virtualClassService = virtualClassService; }
public GatewayPollingService( IDeviceInfo deviceInfo, IHttpService httpService, IReachability reachability, IRepositories repositories, IMvxMessenger messenger, IGatewayService gatewayService, IGatewayQueuedService gatewayQueuedService, IInfoService infoService, IDataChunkService dataChunkService, ICustomPresenter customPresenter, ILoggingService loggingService ) { _deviceInfo = deviceInfo; _httpService = httpService; _reachability = reachability; _repositories = repositories; _messenger = messenger; _gatewayService = gatewayService; _gatewayQueuedService = gatewayQueuedService; _infoService = infoService; _dataChunkService = dataChunkService; _customPresenter = customPresenter; _deviceRepository = repositories.DeviceRepository; _loggingService = loggingService; }
protected override void AdditionalSetup() { _fixture = new Fixture().Customize(new AutoMoqCustomization()); _fixture.Customize <MobileData>(md => md.With(x => x.EffectiveDate, DateTime.Now)); _applicationProfile = _fixture.Create <ApplicationProfile>(); _applicationProfile.DisplaySpan = 3; _applicationProfile.DisplayRetention = 3; _applicationProfileRepoMock = _fixture.InjectNewMock <IApplicationProfileRepository>(); _applicationProfileRepoMock.Setup(aprm => aprm.GetAllAsync()).ReturnsAsync(new List <ApplicationProfile>() { _applicationProfile }); _mockMobileDataRepo = _fixture.InjectNewMock <IMobileDataRepository>(); _fixture.Inject <IRepositories>(_fixture.Create <Repositories>()); _navigationService = _fixture.InjectNewMock <INavigationService>(); _infoService = _fixture.Create <InfoService>(); _fixture.Inject <IInfoService>(_infoService); _mockCustomUserInteraction = Ioc.RegisterNewMock <ICustomUserInteraction>(); _mockMessenger = Ioc.RegisterNewMock <IMvxMessenger>(); _mockMessenger.Setup(m => m.Unsubscribe <GatewayInstructionNotificationMessage>(It.IsAny <MvxSubscriptionToken>())); _mockMessenger.Setup(m => m.Subscribe(It.IsAny <Action <GatewayInstructionNotificationMessage> >(), It.IsAny <MvxReference>(), It.IsAny <string>())).Returns(_fixture.Create <MvxSubscriptionToken>()); Ioc.RegisterSingleton <INavigationService>(_navigationService.Object); }
public SafetyCheckService(Repositories.IRepositories repositories, IGatewayQueuedService gatewayQueuedService, IGpsService gpsService, IInfoService infoService) { _repositories = repositories; _gatewayQueuedService = gatewayQueuedService; _gpsService = gpsService; _infoService = infoService; }
protected override void AdditionalSetup() { _fixture = new Fixture().Customize(new AutoMoqCustomization()); _mockQueueItemRepository = new Mock <Core.Repositories.IGatewayQueueItemRepository>(); var mockDeviceInfo = new Mock <Core.Services.IDeviceInfo>(); mockDeviceInfo.SetupGet(m => m.GatewayPassword).Returns("fleetwoodmobile"); mockDeviceInfo.SetupGet(m => m.MobileApplication).Returns("Orchestrator"); _fixture.Inject <Core.Services.IDeviceInfo>(mockDeviceInfo.Object); // set up info service to have a logged in driver who is licensed _infoService = _fixture.Create <InfoService>(); _fixture.Inject <IInfoService>(_infoService); //(relies on driver TEST TEST (on Proteo test site) not being marked as revoked) _infoService.CurrentDriverID = new Guid("7B5657F7-A0C3-4CAF-AA5F-D76FE942074B"); IEnumerable <Device> devices = new List <Device>() { new Device() { DeviceIdentifier = "021PROTEO0000001" } }; IDeviceRepository repo = Mock.Of <IDeviceRepository>(dr => dr.GetAllAsync() == Task.FromResult(devices)); IRepositories repos = Mock.Of <IRepositories>(r => r.DeviceRepository == repo && r.GatewayQueueItemRepository == _mockQueueItemRepository.Object); _fixture.Register <IRepositories>(() => repos); _messengerMock = _fixture.InjectNewMock <IMvxMessenger>(); }
public SafetyCheckViewModel(IInfoService infoService, INavigationService navigationService, IRepositories repositories, ISafetyCheckService safetyCheckService) { _infoService = infoService; _repositories = repositories; _navigationService = navigationService; _safetyCheckService = safetyCheckService; }
public InstructionSignatureViewModel(INavigationService navigationService, IRepositories repositories, ICustomUserInteraction userInteraction, IInfoService mobileApplicationDataChunkService) { _navigationService = navigationService; _repositories = repositories; _userInteraction = userInteraction; _infoService = mobileApplicationDataChunkService; }
public UserRegisterEventHandler(ILogger <UserRegisterEventHandler> logger, IInfoService infoService) { _logger = logger; _infoService = infoService; }
public InstructionOnSiteViewModel(INavigationService navigationService, IRepositories repositories, IInfoService infoService, IDataChunkService dataChunkService) { _navigationService = navigationService; _repositories = repositories; _infoService = infoService; _dataChunkService = dataChunkService; }
protected override void AdditionalSetup() { _mockUserInteraction = new Mock <ICustomUserInteraction>(); Ioc.RegisterSingleton <ICustomUserInteraction>(_mockUserInteraction.Object); _mockMessenger = new Mock <IMvxMessenger>(); Ioc.RegisterSingleton <IMvxMessenger>(_mockMessenger.Object); _fixture = new Fixture().Customize(new AutoMoqCustomization()); _infoService = _fixture.Create <InfoService>(); _fixture.Inject <IInfoService>(_infoService); _pictureBytes = new byte[] { 1, 2, 3, 4 }; _pictureChooserMock = new Mock <IMvxPictureChooserTask>(); _pictureChooserMock.Setup(pc => pc.TakePicture(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <Action <Stream> >(), It.IsAny <Action>())). Callback <int, int, Action <Stream>, Action>((s1, s2, a1, a2) => { a1.Invoke(new MemoryStream(_pictureBytes)); }); _fixture.Inject <IMvxPictureChooserTask>(_pictureChooserMock.Object); _vehicleSafetyCheckFault = _fixture.Create <SafetyCheckFault>(); _trailerSafetyCheckFault = _fixture.Create <SafetyCheckFault>(); _mockNavigationService = _fixture.InjectNewMock <INavigationService>(); Ioc.RegisterSingleton <INavigationService>(_mockNavigationService.Object); }
public GatewayService(IDeviceInfo deviceInfo, IHttpService httpService, IRepositories repositories, IInfoService infoService, IMvxMessenger messenger) { _deviceInfo = deviceInfo; _httpService = httpService; _infoService = infoService; _messenger = messenger; string urlBase = "http://blueport.gateway.fleetwoodmobile.net:7090"; //TODO: read this from config or somewhere? _gatewayDeviceRequestUrl = urlBase + "/api/gateway/devicerequest"; _gatewayDeviceCreateUrl = urlBase + "/api/gateway/createdevice"; _gatewayConfigRequestUrl = urlBase + "/api/gateway/configrequest"; _gatewayLogMessageUrl = urlBase + "/api/gateway/logmessage"; _gatewayLicenceCheckUrl = urlBase + "/api/gateway/systemcheck"; //Local url, will need to change your own IP //_gatewayDeviceCreateUrl = "http://192.168.3.119:17337/api/gateway/createdevice"; //_gatewayDeviceRequestUrl = "http://192.168.3.119:17337/api/gateway/devicerequest"; //_gatewayLogMessageUrl = "http://192.168.3.119:17337/api/gateway/logmessage"; //_gatewayConfigRequestUrl = "http://192.168.3.119:17337/api/gateway/configrequest"; //_gatewayLicenceCheckUrl = "http://192.168.3.119:17337/api/gateway/systemcheck"; _deviceRepository = repositories.DeviceRepository; }
public OrderViewModel(INavigationService navigationService, IRepositories repositories, IInfoService infoService) { _navigationService = navigationService; _repositories = repositories; _infoService = infoService; _configRepository = repositories.ConfigRepository; }
protected override void AdditionalSetup() { var mockDispatcher = new MockDispatcher(); Ioc.RegisterSingleton <IMvxViewDispatcher>(mockDispatcher); Ioc.RegisterSingleton <IMvxMainThreadDispatcher>(mockDispatcher); _mockUserInteraction = Ioc.RegisterNewMock <ICustomUserInteraction>(); _fixture = new Fixture().Customize(new AutoMoqCustomization()); _fixture.Register <IReachability>(() => Mock.Of <IReachability>(r => r.IsConnected() == true)); _driver = new Core.Models.Driver() { LastName = "TestName", ID = Guid.NewGuid() }; _trailer = new Core.Models.Trailer() { Registration = "TestRegistration", ID = Guid.NewGuid() }; _trailerItemViewModel = new TrailerItemViewModel() { Trailer = _trailer }; _infoService = _fixture.Create <InfoService>(); _infoService.CurrentDriverID = _driver.ID; _fixture.Inject <IInfoService>(_infoService); _currentDriverRepository = new Mock <ICurrentDriverRepository>(); _currentDriverRepository.Setup(cdr => cdr.GetByIDAsync(It.IsAny <Guid>())).ReturnsAsync(new CurrentDriver()); _fixture.Inject <ICurrentDriverRepository>(_currentDriverRepository.Object); _applicationProfile = new ApplicationProfile { LastVehicleAndDriverSync = DateTime.Now }; _applicationRepository = _fixture.InjectNewMock <IApplicationProfileRepository>(); _applicationRepository.Setup(ar => ar.GetAllAsync()).ReturnsAsync(new List <ApplicationProfile>() { _applicationProfile }); _trailerRepository = new Mock <ITrailerRepository>(); _fixture.Inject <ITrailerRepository>(_trailerRepository.Object); var mockAuthenticationService = new Mock <IAuthenticationService>(); mockAuthenticationService.Setup(m => m.AuthenticateAsync(It.IsAny <string>())).ReturnsAsync(new AuthenticationResult { Success = false }); mockAuthenticationService.Setup(m => m.AuthenticateAsync(It.Is <string>(s => s == "9999"))).ReturnsAsync(new AuthenticationResult { Success = true, Driver = _driver }); _fixture.Inject <IAuthenticationService>(mockAuthenticationService.Object); _fixture.Inject <IRepositories>(_fixture.Create <Repositories>()); }
public BotCacheService(IRepository <BotCache, Guid> botCacheRepository, IApartmentService apartmentService, IInfoService infoService, IEventService eventService) { _botCacheRepository = botCacheRepository; _apartmentService = apartmentService; _infoService = infoService; _eventService = eventService; }
/// <summary> /// Default constructor. /// </summary> /// <param name="infoService"></param> /// <param name="applicationSettingsService"></param> /// <param name="options"></param> public ThemeService( IInfoService infoService, IBaseApplicationSettingsService applicationSettingsService, IOptions <ConfigurationOptions> options) : this(applicationSettingsService, options) { _infoService = infoService; }
public ModalCameraViewModel( IMvxPictureChooserTask pictureChooserTask, IInfoService infoService, INavigationService navigationService, IImageUploadService imageUploadService) : base(pictureChooserTask, infoService, navigationService, imageUploadService) { }
public InfoViewModel(IInfoService infoService, IScreenSizeService screenSizeService) : base(Resource.InfoTitle, true) { _infoService = infoService; _screenSizeService = screenSizeService; OpenMapCommand = new Command <EnderecoWrapper>(ExecuteOpenMapCommand); Items = new ObservableCollection <SummitInfoWrapper>(); }
public TrailerListViewModel(IGatewayService gatewayService, IRepositories repositories, IReachability reachabibilty, IToast toast, IInfoService infoService, INavigationService navigationService) : base(gatewayService, repositories, reachabibilty, toast, infoService, navigationService) { _applicationProfileRepository = repositories.ApplicationRepository; }
public BotCacheController(IBotCacheService botCacheService, ILocationService locationService, IApartmentService apartmentService, IEventService eventService, IInfoService infoService) { _botCacheService = botCacheService; _locationService = locationService; _apartmentService = apartmentService; _eventService = eventService; _infoService = infoService; }
/// <summary> /// Initializes a new instance of the <see cref="TelemetryService" /> class. /// </summary> /// <param name="context">The context.</param> /// <param name="infoService">The information service.</param> /// <param name="options">The options.</param> public TelemetryService(IContext context, IInfoService infoService, IOptions <AppCenterOptions> options) { _context = context; _infoService = infoService; _appCenterOptions = options.Value; AppCenter.LogLevel = LogLevel.Verbose; AppCenter.Start(_appCenterOptions.Key, typeof(Analytics), typeof(Crashes)); }
protected override void AdditionalSetup() { _mockUserInteraction = new Mock <ICustomUserInteraction>(); Ioc.RegisterSingleton <ICustomUserInteraction>(_mockUserInteraction.Object); _mockMessenger = new Mock <IMvxMessenger>(); Ioc.RegisterSingleton <IMvxMessenger>(_mockMessenger.Object); _fixture = new Fixture().Customize(new AutoMoqCustomization()); _fixture.OmitProperty("EffectiveDateString"); _fixture.Customize <InstructionSafetyCheckViewModel>(vm => vm.Without(x => x.SafetyCheckItemViewModels)); _fixture.Customize <InstructionSafetyCheckViewModel>(vm => vm.Without(x => x.SafetyProfileVehicle)); _fixture.Customize <SafetyCheckFault>(vm => vm.With(x => x.Status, Core.Enums.SafetyCheckStatus.Passed)); _driver = _fixture.Create <Core.Models.Driver>(); _vehicle = _fixture.Create <Core.Models.Vehicle>(); _trailer = _fixture.Create <Core.Models.Trailer>(); _infoService = _fixture.Create <InfoService>(); _fixture.Inject <IInfoService>(_infoService); _infoService.SetCurrentDriver(_driver); _infoService.SetCurrentVehicle(_vehicle); _safetyCheckService = _fixture.Create <SafetyCheckService>(); _fixture.Inject <ISafetyCheckService>(_safetyCheckService); _mobileData = _fixture.SetUpInstruction(Core.Enums.InstructionType.Collect, false, true, false, false, false, false, true, null); _navData = new NavData <MobileData>() { Data = _mobileData }; _navData.OtherData["UpdatedTrailer"] = _trailer; _safetyCheckService.CurrentVehicleSafetyCheckData = _vehicleSafetyCheckData = _fixture.Create <SafetyCheckData>(); _navData.OtherData["UpdatedTrailerSafetyCheckData"] = _trailerSafetyCheckData = _fixture.Create <SafetyCheckData>(); var mockMobileDataRepo = _fixture.InjectNewMock <IMobileDataRepository>(); mockMobileDataRepo.Setup(mdr => mdr.GetByIDAsync(It.Is <Guid>(i => i == _mobileData.ID))).ReturnsAsync(_mobileData); _mockSafetyProfileRepository = _fixture.InjectNewMock <ISafetyProfileRepository>(); _mockConfigRepository = _fixture.InjectNewMock <IConfigRepository>(); _mockVehicleRepo = _fixture.InjectNewMock <IVehicleRepository>(); _mockVehicleRepo.Setup(vr => vr.GetByIDAsync(_vehicle.ID)).ReturnsAsync(_vehicle); var repositories = _fixture.Create <Repositories>(); _fixture.Inject <IRepositories>(repositories); _mockNavigationService = _fixture.InjectNewMock <INavigationService>(); Ioc.RegisterSingleton <INavigationService>(_mockNavigationService.Object); _safetyProfiles = CreateSafetyProfiles(); }
public BaseTrailerListViewModel(IGatewayService gatewayService, IRepositories repositories, IReachability reachabilty, IToast toast, IInfoService infoService, INavigationService navigationService) { _reachability = reachabilty; _toast = toast; _infoService = infoService; _navigationService = navigationService; _gatewayService = gatewayService; _repositories = repositories; ProgressMessage = "Updating Trailers."; }
public InboxViewModel( IRepositories repositories, IInfoService infoService, INavigationService navigationService, IGatewayPollingService gatewayPollingService) { _mobileDataRepository = repositories.MobileDataRepository; _infoService = infoService; _navigationService = navigationService; _gatewayPollingService = gatewayPollingService; }
public InstructionTrailerViewModel(IGatewayService gatewayService, INavigationService navigationService, IRepositories repositories, IReachability reachabiity, IToast toast, IInfoService startUpService) : base(gatewayService, repositories, reachabiity, toast, startUpService, navigationService) { _notificationToken = Messenger.Subscribe <Messages.GatewayInstructionNotificationMessage>(async m => await CheckInstructionNotificationAsync(m)); _applicationProfileRepository = _repositories.ApplicationRepository; }
public ReviseQuantityViewModel( INavigationService navigationService, IRepositories repositories, IInfoService infoService, IDataChunkService dataChunkService) { _navigationService = navigationService; _repositories = repositories; _infoService = infoService; _dataChunkService = dataChunkService; }
public Footer( IPhoneService phoneSer, IInfoService infoSer, IAddressService addressSer, ISocialService socialSer) { _phoneSer = phoneSer; _infoSer = infoSer; _addressSer = addressSer; _socialSer = socialSer; }
/// <summary> /// Initializes a new instance of the <see cref="TelemetryService"/> class. /// </summary> /// <param name="infoService">The information service.</param> /// <param name="options"></param> public TelemetryService(IInfoService infoService, IOptions <ApplicationInsightsOptions> options) { _applicationInsightsOptions = options.Value; var config = new TelemetryConfiguration(_applicationInsightsOptions.Key); Client = new TelemetryClient(config); Client.Context.User.UserAgent = infoService.ProductName; Client.Context.Component.Version = infoService.ProductVersion.ToString(); Client.Context.Session.Id = Guid.NewGuid().ToString(); Client.Context.Device.OperatingSystem = Environment.OSVersion.ToString(); }
/// <summary> /// Initializes a new instance of the /// <see cref="BrowserStackLoginHelper"/> class. /// </summary> public BrowserStackLoginHelper(IAsyncActionsFactory asyncActionsFactory, IInfoService infoService, IServiceInvoker serviceInvoker, IUserCredentials userCredentials, IApolloServicesLocations apolloServicesLocations, ICookieContainerSpecificWebRequestCreator cookieContainerSpecificWebRequestCreator) { mAsyncActionsFactory = asyncActionsFactory; mCookieContainerSpecificWebRequestCreator = cookieContainerSpecificWebRequestCreator; mServiceInvoker = serviceInvoker; mUserCredentials = userCredentials; mApolloServicesLocations = apolloServicesLocations; mInfoService = infoService; }
private void createServices() { timeService = new TimeService(); eventService = new EventService(); uiFactoryService = new UIFactoryService(); wwwService = new FakeWwwService();//controller.GameObject.AddComponent<WwwService>(); viewService = new ViewService(eventService, uiFactoryService); loadService = new LoadService(eventService); gameService = new GameService(pool, viewService); pathService = new PathService(pool, wwwService, eventService); levelService = new LevelService(wwwService, eventService); enemyService = new EnemyService(pool, wwwService, eventService); bonusService = new BonusService(pool, wwwService, eventService); difficultyService = new DifficultyService(pool, wwwService, eventService); infoService = new InfoService(viewService, uiFactoryService, eventService); settingsService = new SettingsService(pool); translationService = new TranslationService(settingsService); languageService = new LanguageService(wwwService, eventService); analyticsService = new AnalyticsService(settingsService); shipService = new ShipService(timeService, eventService); gamerService = new GamerService(eventService); currencyService = new CurrencyService(eventService, gamerService); iapService = new IAPService(eventService); adService = new AdService(currencyService); shopService = new ShopService(currencyService, eventService, iapService); updateables.Add(infoService); }
public Info() { _repository = Global.GetObject<IRepository>(); _infoService = Global.GetObject<IInfoService>(); }
public InfoController(IInfoService infoService) { this.infoService = infoService; }