-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fuzzlemann
committed
Aug 17, 2017
1 parent
1558794
commit 47d9725
Showing
2 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Plan/test/test/java/main/java/com/djrapitops/plan/utilities/dump/DumpLogTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package test.java.main.java.com.djrapitops.plan.utilities.dump; | ||
|
||
import main.java.com.djrapitops.plan.utilities.file.dump.DumpLog; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* @author Fuzzlemann | ||
*/ | ||
public class DumpLogTest { | ||
|
||
@Test | ||
public void testDumpLogCreation() { | ||
DumpLog testLog = new DumpLog(); | ||
|
||
testLog.addHeader("Test Header"); | ||
testLog.add("StringValue", "Test"); | ||
testLog.add("BooleanValue", true); | ||
testLog.add("IterableValue", Arrays.asList("Iterable 1", "Iterable 2")); | ||
|
||
testLog.addLine(new StringBuilder("CharSequence Test")); | ||
testLog.addLines(new StringBuilder("CharSequences Test"), new StringBuilder("CharSequences Test")); | ||
testLog.addLines(Arrays.asList("Iterable 1", "Iterable 2")); | ||
|
||
String expResult = "\n--- Test Header ---\n" + | ||
"StringValue: Test\n" + | ||
"BooleanValue: true\n" + | ||
"IterableValue: Iterable 1, Iterable 2\n" + | ||
"CharSequence Test\n" + | ||
"CharSequences Test\n" + | ||
"CharSequences Test\n" + | ||
"Iterable 1\n" + | ||
"Iterable 2"; | ||
String result = testLog.toString(); | ||
|
||
Assert.assertEquals(expResult, result); | ||
} | ||
} |