Azavea.Open.Common.Tests.TimedCacheTests.TryGetTest2 C# (CSharp) Метод

TryGetTest2() приватный Метод

private TryGetTest2 ( ) : void
Результат void
        public void TryGetTest2()
        {
            TimedCache<int, int> cache = new TimedCache<int, int>(new TimeSpan(0, 1, 0));

            int output = 5;
            Assert.IsFalse(cache.TryGet(1, ref output));
            Assert.AreEqual(5, output);

            cache.Set(10, output);
            int output2 = Int32.MinValue;
            Assert.IsTrue(cache.TryGet(10, ref output2));
            Assert.AreEqual(5, output2);

            output = 15;
            cache.Set(10, output);
            int output3 = Int32.MinValue;
            Assert.IsTrue(cache.TryGet(10, ref output3));
            Assert.AreEqual(15, output3);
        }