package de.ugoe.cs.eventbench.models;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import org.junit.*;
import de.ugoe.cs.eventbench.data.Event;
import static org.junit.Assert.*;
/**
* The class ModelFlattenerTest
contains tests for the class {@link ModelFlattener}
.
*
* @author Steffen Herbold
* @version 1.0
*/
public class ModelFlattenerTest {
List> sequence;
private static void assertCollectionContent(Collection> c1, Collection> c2) {
assertEquals(c1.size(), c2.size());
for( Object obj : c1 ) {
assertTrue(c2.contains(obj));
}
}
@Test
public void testFlattenHighOrderMarkovModel_1()
throws Exception {
ModelFlattener fixture = new ModelFlattener();
HighOrderMarkovModel model = new HighOrderMarkovModel(2, new Random());
Collection>> sequences = new ArrayList>>();
sequences.add(sequence);
model.train(sequences);
Collection> expectedSymbols = new HashSet>();
expectedSymbols.add(new Event