public void TestNamedCache3() { Assert.AreEqual(0, cache2.Hits); Assert.AreEqual(0, cache2.Misses); var service = new Service2(); IEnumerable <string> result; result = service.MethodToCache1(2.0); Assert.AreEqual(0, cache2.Hits); Assert.AreEqual(2, cache2.Misses); CollectionAssert.AreEqual(new[] { "0.9", "1.9" }, result.ToArray()); result = service.MethodToCache1(2.0); Assert.AreEqual(1, cache2.Hits); Assert.AreEqual(2, cache2.Misses); CollectionAssert.AreEqual(new[] { "0.9", "1.9" }, result.ToArray()); result = service.MethodToCache1(2); Assert.AreEqual(1, cache2.Hits); Assert.AreEqual(4, cache2.Misses); CollectionAssert.AreEqual(new[] { "1", "2" }, result.ToArray()); result = service.MethodToCache1(2); Assert.AreEqual(2, cache2.Hits); Assert.AreEqual(4, cache2.Misses); CollectionAssert.AreEqual(new[] { "1", "2" }, result.ToArray()); }
public void TestNamedCache2() { var service = new Service2(); var result = service.MethodToCache1(2); CollectionAssert.AreEqual(new[] { "1", "2" }, result.ToArray()); CollectionAssert.AreEqual(new[] { "1", "2" }, result.ToArray()); }
public void TestNamedCache2() { var service = new Service2(); var result = service.MethodToCache1(2); LinqAssert.AreSame(new [] { "1", "2" }, result); LinqAssert.AreSame(new[] { "1", "2" }, result); }
public void TestNamedCache1() { Assert.AreEqual(0, cache2.Hits); Assert.AreEqual(0, cache2.Misses); var service = new Service2(); var result = service.MethodToCache1(); Assert.AreEqual(0, cache2.Hits); Assert.AreEqual(2, cache2.Misses); }