Example #1
0
        public void TestTryRead()
        {
            cache.Write("foo", ToStream("foo"));

            Assert.AreEqual(true, cache.TryRead("foo", out Stream stream));
            using (stream)
            {
                Assert.AreEqual("foo", stream.ToText());
            }
        }
Example #2
0
 public void TestTryRead()
 {
     cache.Write("foo", "foo");
     Assert.IsTrue(cache.TryRead("foo", out string _));
     Assert.IsFalse(cache.TryRead("cache-not-exists", out _));
 }