You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/12/07 20:43:33 UTC

svn commit: r888107 - /incubator/lucene.net/trunk/C#/src/Test/TestSupportClass.cs

Author: digy
Date: Mon Dec  7 19:43:32 2009
New Revision: 888107

URL: http://svn.apache.org/viewvc?rev=888107&view=rev
Log:
Since SimpleLRUCache is not a direct port from Lucene.Java, I add another test case which I used in testing LUCENENET-190.

Modified:
    incubator/lucene.net/trunk/C#/src/Test/TestSupportClass.cs

Modified: incubator/lucene.net/trunk/C#/src/Test/TestSupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/TestSupportClass.cs?rev=888107&r1=888106&r2=888107&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/TestSupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/TestSupportClass.cs Mon Dec  7 19:43:32 2009
@@ -718,4 +718,26 @@
             }
         }
     }
+
+    [TestFixture]
+    public class TestLRUCache
+    {
+        [Test]
+        public void Test()
+        {
+            Lucene.Net.Util.Cache.SimpleLRUCache cache = new Lucene.Net.Util.Cache.SimpleLRUCache(3);
+            cache.Put("a", "a");
+            cache.Put("b", "b");
+            cache.Put("c", "c");
+            Assert.IsNotNull(cache.Get("a"));
+            Assert.IsNotNull(cache.Get("b"));
+            Assert.IsNotNull(cache.Get("c"));
+            cache.Put("d", "d");
+            Assert.IsNull(cache.Get("a"));
+            Assert.IsNotNull(cache.Get("c"));
+            cache.Put("e", "e");
+            cache.Put("f", "f");
+            Assert.IsNotNull(cache.Get("c"));
+        }
+    }
 }
\ No newline at end of file