Example #1
0
        public void AllCacheIsCleared()
        {
            // assemble
            ResourceListCacheManager sut = CreateSut();

            (string berryUri, NamedApiResourceList <Berry> berryList)  = CreateFakeNamedResourceList <Berry>();
            (string machineUri, ApiResourceList <Machine> machineList) = CreateFakeApiResourceList <Machine>();
            sut.Store(berryUri, berryList);
            sut.Store(machineUri, machineList);

            // act
            sut.ClearAll();

            // assert
            NamedApiResourceList <Berry> cacheddBerryList  = sut.GetNamedResourceList <Berry>(berryUri);
            ApiResourceList <Machine>    cachedMachineList = sut.GetApiResourceList <Machine>(machineUri);

            Assert.Null(cacheddBerryList);
            Assert.Null(cachedMachineList);
        }
 /// <summary>
 /// Clears all cached data for both resources and resource lists
 /// </summary>
 public void ClearCache()
 {
     _resourceCache.ClearAll();
     _resourceListCache.ClearAll();
 }