public void RetrieveMultipleArgumentsWithNonPrimitiveArgumentShouldNotGenerateKey() { var repo = new TestRepository(); var generator = new CacheKeyGenerator(); string key; var result = generator.TryBuildCacheKey(() => repo.RetrievePerson(new Person(), 1), out key); Assert.IsFalse(result); }
public void RegularRetrieveWithArgumentsGetsGenerated() { var repo = new TestRepository(); var generator = new CacheKeyGenerator(); string key; generator.TryBuildCacheKey(() => repo.RetrievePerson(1), out key); Assert.AreEqual("RetrievePerson#1", key); }
public void AsyncRetrieveCacheKeyGetsGenerated() { var repo = new TestRepository(); var generator = new CacheKeyGenerator(); string key; generator.TryBuildCacheKey(() => repo.RetrievePersonsAsync(), out key); Assert.AreEqual("RetrievePersonsAsync", key); }