Added unit tests for RuntimeEnvironment

This commit is contained in:
Mike Cifelli 2017-02-14 14:28:47 -05:00
parent b3ae5c9122
commit ea57fc8bae
1 changed files with 35 additions and 0 deletions

View File

@ -77,4 +77,39 @@ public class RuntimeEnvironmentTester {
assertEquals(errorManager, environment.getErrorManager()); assertEquals(errorManager, environment.getErrorManager());
} }
@Test
public void assignOutputDecorator() {
environment.setOutputDecorator(s -> "[" + s + "]");
assertEquals("[test]", environment.decorateOutput("test"));
}
@Test
public void assignValueOutputDecorator() {
environment.setValueOutputDecorator(s -> "(" + s + ")");
assertEquals("(test)", environment.decorateValueOutput("test"));
}
@Test
public void assignWarningOutputDecorator() {
environment.setWarningOutputDecorator(s -> "|" + s + "|");
assertEquals("|test|", environment.decorateWarningOutput("test"));
}
@Test
public void assignErrorOutputDecorator() {
environment.setErrorOutputDecorator(s -> "{" + s + "}");
assertEquals("{test}", environment.decorateErrorOutput("test"));
}
@Test
public void assignCriticalOutputDecorator() {
environment.setCriticalOutputDecorator(s -> "/" + s + "/");
assertEquals("/test/", environment.decorateCriticalOutput("test"));
}
} }