forked from museumsvictoria/nodel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Cover SimpleNameTest with a couple of test cases - Ensure they pass
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
nodel-framework/src/test/java/org/nodel/SimpleNameTest.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,37 @@ | ||
package org.nodel; | ||
|
||
import org.junit.jupiter.api.TestInstance; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
class SimpleNameTest { | ||
|
||
@ParameterizedTest | ||
@ValueSource(strings = { | ||
"node_name", | ||
"Node Name", | ||
"node-name", | ||
"node.name", | ||
"node name" | ||
}) | ||
void testGetOriginalName(String originalName) { | ||
SimpleName name = new SimpleName(originalName); | ||
assertEquals(originalName, name.getOriginalName()); | ||
} | ||
|
||
@ParameterizedTest | ||
@CsvSource({ | ||
"node_name, nodename", | ||
"Node Name, NodeName", | ||
"node-name, nodename", | ||
"node.name, nodename", | ||
"node name, nodename" | ||
}) | ||
public void testGetReducedName(String originalName, String expectedReducedName) { | ||
SimpleName name = new SimpleName(originalName); | ||
assertEquals(expectedReducedName, name.getReducedName()); | ||
} | ||
} |