コード例 #1
0
            public void ShouldUpdateTheCacheWhenFetchingSucceeds(int ratingViewDayCount, RatingViewCriterion ratingViewCriterion, bool registerPushes, bool handlePushes)
            {
                var expectedRatingViewConfiguration        = new RatingViewConfiguration(ratingViewDayCount, ratingViewCriterion);
                var expectedPushNotificationsConfiguration = new PushNotificationsConfiguration(registerPushes, handlePushes);
                var mockFetchRemoteConfigService           = new MockFetchRemoteConfigService(
                    true,
                    ratingViewConfigurationToReturn: expectedRatingViewConfiguration,
                    pushNotificationsConfigurationReturn: expectedPushNotificationsConfiguration);

                UpdateRemoteConfigCacheService = new UpdateRemoteConfigCacheService(TimeService, KeyValueStorage, mockFetchRemoteConfigService);

                UpdateRemoteConfigCacheService.FetchAndStoreRemoteConfigData();

                KeyValueStorage.Received().SetInt(RatingViewDelayParameter, ratingViewDayCount);
                KeyValueStorage.Received().SetString(RatingViewTriggerParameter, ratingViewCriterion.ToString());
                KeyValueStorage.Received().SetBool(RegisterPushNotificationsTokenWithServerParameter, registerPushes);
                KeyValueStorage.Received().SetBool(HandlePushNotificationsParameter, handlePushes);
            }