-
Notifications
You must be signed in to change notification settings - Fork 20
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
1 parent
2ba740d
commit bc846c5
Showing
3 changed files
with
88 additions
and
48 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
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
34 changes: 34 additions & 0 deletions
34
vcell-cli/src/test/java/org/vcell/cli/run/RunUtilsTest.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,34 @@ | ||
package org.vcell.cli.run; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.HashMap; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Tag("Fast") | ||
public class RunUtilsTest { | ||
private final String VERTICAL_CSV = """ | ||
Street-based,Sea-based,Snow-based | ||
Skateboard,Wake Board,Snowboard | ||
Rollerblades,Water Skis,Alpine / Cross-country Skis | ||
Bike,Water Bike,<None> | ||
Motorcycle,Boatercycle (Jet-Ski),Snow Bike / Snowmobile"""; | ||
private final String HORIZONTAL_CSV = """ | ||
Street-based,Skateboard,Rollerblades,Bike,Motorcycle | ||
Sea-based,Wake Board,Water Skis,Water Bike,Boatercycle (Jet-Ski) | ||
Snow-based,Snowboard,Alpine / Cross-country Skis,<None>,Snow Bike / Snowmobile"""; | ||
|
||
@Test | ||
public void testCSVFormatting(){ | ||
Map<String, List<String>> csvContents = new LinkedHashMap<>(); | ||
csvContents.put("Street-based", List.of("Skateboard", "Rollerblades", "Bike", "Motorcycle")); | ||
csvContents.put("Sea-based", List.of("Wake Board", "Water Skis", "Water Bike", "Boatercycle (Jet-Ski)")); | ||
csvContents.put("Snow-based", List.of("Snowboard", "Alpine / Cross-country Skis", "<None>", "Snow Bike / Snowmobile")); | ||
Assertions.assertEquals(VERTICAL_CSV, RunUtils.formatCSVContents(csvContents, true)); | ||
Assertions.assertEquals(HORIZONTAL_CSV, RunUtils.formatCSVContents(csvContents, false)); | ||
} | ||
} |