commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1499841 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
Date Thu, 04 Jul 2013 18:54:42 GMT
Author: sebb
Date: Thu Jul  4 18:54:42 2013
New Revision: 1499841

URL: http://svn.apache.org/r1499841
Log:
The values are constants, so make them so

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java?rev=1499841&r1=1499840&r2=1499841&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/FrequencyTest.java
Thu Jul  4 18:54:42 2013
@@ -332,5 +332,19 @@ public final class FrequencyTest {
         Assert.assertEquals(1, f.getCount(twoI));
         Assert.assertEquals(1, f.getCount(threeI));        
     }
+    
+    @Test
+    public void testMode() {
+        Assert.assertEquals(0, f.getMode().size());
+        f.addValue("1");
+        Assert.assertEquals(1, f.getMode().size());
+        f.addValue("2");
+        Assert.assertEquals(2, f.getMode().size());
+        Assert.assertTrue(f.getMode().contains("1"));
+        Assert.assertTrue(f.getMode().contains("2"));
+        f.addValue("2");
+        Assert.assertEquals(1, f.getMode().size());
+        Assert.assertFalse(f.getMode().contains("1"));
+        Assert.assertTrue(f.getMode().contains("2"));
+    }
 }
-



Mime
View raw message