AgileWallaby.Ehcache.Test.EhcacheServerCacheTest.Get_Throws_KeyNotFoundException_If_Key_Does_Not_Exist C# (CSharp) Method

Get_Throws_KeyNotFoundException_If_Key_Does_Not_Exist() private method

        public void Get_Throws_KeyNotFoundException_If_Key_Does_Not_Exist()
        {
            var cache = new EhcacheServerCache(ehcacheUri, "sampleCache1");
            cache.RemoveAll();

            try
            {
                var value = cache["testKey"];
                Assert.Fail("Should have thrown an exception.");
            }
            catch (KeyNotFoundException e)
            {
                Assert.AreEqual("Key testKey is not present in cache sampleCache1.", e.Message);
            }
            
        }
    }