lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r888107 - /incubator/lucene.net/trunk/C#/src/Test/TestSupportClass.cs
Date Mon, 07 Dec 2009 19:43:33 GMT
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



Mime
View raw message