コード例 #1
0
        public void Cache_2SharedComponents_Dummies()
        {
            var dummyCache = new DummyCache <string>();
            var cache      = new TestCache2(dummyCache, dummyCache);

            var s    = new[] { "s1", "s2", "s3", "s4" };
            var ref1 = cache.Create(s);

            Assert.IsTrue(s.SequenceEqual(ref1.Value));
        }
コード例 #2
0
        public void Cache_2SharedComponents_GetValueAfterDispose()
        {
            var cache = new TestCache2();
            var s     = new[] { "s1", "s2", "s3", "s4" };
            var ref0  = cache.Create(s);

            ref0.Dispose();
            var unused = default(string[]);

            Assert.ThrowsException <ObjectDisposedException>(() => unused = ref0.Value);
        }
コード例 #3
0
        public void Cache_2SharedComponents()
        {
            var cache1 = new TestCache2();

            Assert.IsNull(cache1.Create(value: null).Value);

            var s = new[] { "s1", "s2", "s3", "s4" };

            var ref0 = cache1.Create(s);

            Assert.IsTrue(s.SequenceEqual(ref0.Value));
        }