Example #1
0
        public HomePageViewModel(
            INavigationService navigationService,
            ILoggerService loggerService,
            IUserDataRepository userDataRepository,
            IExposureDataRepository exposureDataRepository,
            IExposureRiskCalculationService exposureRiskCalculationService,
            AbsExposureNotificationApiService exposureNotificationApiService,
            ILocalNotificationService localNotificationService,
            AbsExposureDetectionBackgroundService exposureDetectionBackgroundService,
            IExposureConfigurationRepository exposureConfigurationRepository,
            IExposureRiskCalculationConfigurationRepository exposureRiskCalculationConfigurationRepository,
            ICheckVersionService checkVersionService,
            IEssentialsService essentialsService,
            IDialogService dialogService,
            IExternalNavigationService externalNavigationService
            ) : base(navigationService)
        {
            Title = AppResources.HomePageTitle;

            this.loggerService                                  = loggerService;
            this._userDataRepository                            = userDataRepository;
            this._exposureDataRepository                        = exposureDataRepository;
            this._exposureRiskCalculationService                = exposureRiskCalculationService;
            this.exposureNotificationApiService                 = exposureNotificationApiService;
            this.localNotificationService                       = localNotificationService;
            this.exposureDetectionBackgroundService             = exposureDetectionBackgroundService;
            this.exposureConfigurationRepository                = exposureConfigurationRepository;
            this.exposureRiskCalculationConfigurationRepository = exposureRiskCalculationConfigurationRepository;
            this.checkVersionService                            = checkVersionService;
            this.essentialsService                              = essentialsService;
            this.dialogService                                  = dialogService;
            this.externalNavigationService                      = externalNavigationService;
        }
Example #2
0
        private async void IsUpdate(bool isIos, string version, bool expected)
        {
            string content = GetTestJson(JSON_VERSION1);

            var jsonContent = new StringContent(
                content,
                Encoding.UTF8,
                "application/json"
                );
            var client = HttpClientUtils.CreateHttpClient(HttpStatusCode.OK, jsonContent);

            _mockClientService.Setup(x => x.Create()).Returns(client);

            _mockEssentialsService.Setup(x => x.IsIos).Returns(isIos);
            _mockEssentialsService.Setup(x => x.AppVersion).Returns(version);

            ICheckVersionService service = CreateService();

            bool isUpdated = await service.IsUpdateVersionExistAsync();

            Assert.Equal(expected, isUpdated);
        }