26 lines
681 B
Java
26 lines
681 B
Java
package dk.itu.mario.level.grammar;
|
|
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
import java.io.File;
|
|
|
|
import org.junit.Test;
|
|
|
|
public class LevelGrammarFactoryTest {
|
|
@Test
|
|
public void testCreateGrammar() {
|
|
LevelGrammar levelGrammar = LevelGrammarFactory.createGrammar();
|
|
assertNotNull(levelGrammar);
|
|
System.out.println(levelGrammar.toString());
|
|
}
|
|
|
|
@Test
|
|
public void testReadFile() throws Exception {
|
|
File grammarFile = new File("grammars/overland.grm");
|
|
LevelGrammar levelGrammar = LevelGrammarFactory.createGrammar(grammarFile);
|
|
assertNotNull(levelGrammar);
|
|
System.out.println("Read Grammar from file:");
|
|
System.out.println(levelGrammar.toString());
|
|
}
|
|
}
|