public async Task Load_WhenTogglesOrEtagFileDoesNotExists_ReturnsEmptyResult(
            bool toggleCollectionExists,
            bool etagExists,
            [Frozen] MemoryToggleCollectionCacheSettings settings,
            [Frozen] MemoryCache memoryCache,
            MemoryToggleCollectionCache cache
            )
        {
            settings.EtagKeyName             = "Etag";
            settings.ToggleCollectionKeyName = "Toggles";

            if (toggleCollectionExists)
            {
                var toggleCollection = new ToggleCollection();
                memoryCache.Set(settings.ToggleCollectionKeyName, toggleCollection);
            }

            if (toggleCollectionExists && etagExists)
            {
                var etag = Guid.NewGuid().ToString();
                memoryCache.Set(settings.EtagKeyName, etag);
            }

            var result = await cache.Load(CancellationToken.None);

            Assert.Equal(string.Empty, result.InitialETag);
            Assert.Null(result.InitialToggleCollection);
        }
        public async Task Load_WhenCancellationTokenIsCanceled_ThrowsOperationCancelledException(
            MemoryToggleCollectionCache cache
            )
        {
            var cts = new CancellationTokenSource();

            cts.Cancel();

            await Assert.ThrowsAsync <OperationCanceledException>(() => cache.Load(cts.Token));
        }
        public async Task Load_WhenValidToggleAndEtagFilesExist_ReturnsExpectedResult(
            [Frozen] MemoryToggleCollectionCacheSettings settings,
            [Frozen] MemoryCache memoryCache,
            ToggleCollection toggleCollection,
            string etag
            )
        {
            settings.EtagKeyName             = "Etag";
            settings.ToggleCollectionKeyName = "Toggles";

            memoryCache.Set(settings.ToggleCollectionKeyName, toggleCollection);
            memoryCache.Set(settings.EtagKeyName, etag);

            var cache  = new MemoryToggleCollectionCache(settings, memoryCache);
            var result = await cache.Load(CancellationToken.None);

            Assert.Equal(etag, result.InitialETag);
            Assert.Same(toggleCollection, result.InitialToggleCollection);
        }