From ea57fc8bae03807e50c25d499f6b3a2322c4ec93 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Tue, 14 Feb 2017 14:28:47 -0500 Subject: [PATCH] Added unit tests for RuntimeEnvironment --- .../environment/RuntimeEnvironmentTester.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test/environment/RuntimeEnvironmentTester.java b/test/environment/RuntimeEnvironmentTester.java index fa87a7c..1dbbe1a 100644 --- a/test/environment/RuntimeEnvironmentTester.java +++ b/test/environment/RuntimeEnvironmentTester.java @@ -77,4 +77,39 @@ public class RuntimeEnvironmentTester { 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")); + } + }