Exemplo n.º 1
0
        public static async Task TestCacheAsync(Func <ICache> cacheFactory)
        {
            CacheTester tester = new CacheTester();

            var methods = tester.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);

            foreach (var testMethod in methods)
            {
                var cache = cacheFactory().WithSource(new Example());

                var testResult = testMethod.Invoke(tester, new object[] { cache });
                if (testResult is Task)
                {
                    await(testResult as Task);
                }
            }
        }
Exemplo n.º 2
0
 public async Task Implementation_SimpleCache()
 {
     Func <ICache> factory = () => new FluentDictionaryCache();
     await CacheTester.TestCacheAsync(factory);
 }
Exemplo n.º 3
0
 public async Task Implementation_RuntimeMemoryCache()
 {
     await CacheTester.TestCacheAsync(CreateCache);
 }
Exemplo n.º 4
0
 public async Task Implementation_MemoryCache()
 {
     await CacheTester.TestCacheAsync(CacheFactory);
 }