public void Cache_4SharedComponents() { var cache1 = new TestCache4(); Assert.IsNull(cache1.Create(value: null).Value); var s = new[] { "s1", "s2", "s3", "s4", "s5", "s6" }; var ref0 = cache1.Create(s); Assert.IsTrue(s.SequenceEqual(ref0.Value)); }
public void Cache_4SharedComponents_Dummies() { var dummyCache = new DummyCache <string>(); var cache = new TestCache4(dummyCache, dummyCache, dummyCache, dummyCache); var s = new[] { "s1", "s2", "s3", "s4", "s5", "s6" }; var ref1 = cache.Create(s); Assert.IsTrue(s.SequenceEqual(ref1.Value)); }
public void Cache_4SharedComponents_GetValueAfterDispose() { var cache = new TestCache4(); var s = new[] { "s1", "s2", "s3", "s4", "s5", "s6" }; var ref0 = cache.Create(s); ref0.Dispose(); var unused = default(string[]); Assert.ThrowsException <ObjectDisposedException>(() => unused = ref0.Value); }