mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
Implemented a very dirty hack to format clusters without touching com.sap.sse.datamining
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
package com.sap.sailing.datamining.impl.data;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sse.datamining.data.Cluster;
|
||||
import com.sap.sse.datamining.data.ClusterGroup;
|
||||
|
||||
public class TestPercentageClusterFormatter {
|
||||
|
||||
private ClusterGroup<Double> percentageClusterGroup;
|
||||
private PercentageClusterFormatter formatter;
|
||||
|
||||
@Before
|
||||
public void initialize() {
|
||||
percentageClusterGroup = new LinearDoubleClusterGroup(0.0, 1.0, 0.1, true);
|
||||
formatter = new PercentageClusterFormatter();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormat() {
|
||||
Cluster<Double> cluster = percentageClusterGroup.getClusterFor(0.05);
|
||||
String formattedCluster = formatter.format(cluster);
|
||||
assertThat(formattedCluster, is("[0% - 10%["));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user