Skip to content

Commit

Permalink
SpreadsheetComparatorNameListTest.testParseXXX
Browse files Browse the repository at this point in the history
  • Loading branch information
mP1 committed Sep 21, 2024
1 parent 23cd8c3 commit d3e4938
Showing 1 changed file with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import walkingkooka.net.HasUrlFragmentTesting;
import walkingkooka.reflect.ClassTesting;
import walkingkooka.reflect.JavaVisibility;
import walkingkooka.test.ParseStringTesting;
import walkingkooka.tree.json.JsonNode;
import walkingkooka.tree.json.marshall.JsonNodeMarshallingTesting;
import walkingkooka.tree.json.marshall.JsonNodeUnmarshallContext;
Expand All @@ -35,6 +36,7 @@ public class SpreadsheetComparatorNameListTest implements ListTesting2<Spreadshe
ClassTesting<SpreadsheetComparatorNameList>,
ImmutableListTesting<SpreadsheetComparatorNameList, SpreadsheetComparatorName>,
HasUrlFragmentTesting,
ParseStringTesting<SpreadsheetComparatorNameList>,
JsonNodeMarshallingTesting<SpreadsheetComparatorNameList> {

private final static SpreadsheetComparatorName DATE1 = SpreadsheetComparatorName.DATE;
Expand Down Expand Up @@ -137,6 +139,74 @@ public void testHasUrlFragment() {
);
}

// parseString......................................................................................................

@Override
public void testParseStringEmptyFails() {
throw new UnsupportedOperationException();
}

@Test
public void testParseEmpty() {
this.parseStringAndCheck(
"",
SpreadsheetComparatorNameList.EMPTY
);
}

@Test
public void testParseName() {
this.parseStringAndCheck(
"day-of-month",
SpreadsheetComparatorNameList.with(
Lists.of(
SpreadsheetComparatorName.DAY_OF_MONTH
)
)
);
}

@Test
public void testParseNameCommaName() {
this.parseStringAndCheck(
"day-of-month,year",
SpreadsheetComparatorNameList.with(
Lists.of(
SpreadsheetComparatorName.DAY_OF_MONTH,
SpreadsheetComparatorName.YEAR
)
)
);
}

@Test
public void testParseSpaceNameSpaceCommaName() {
this.parseStringAndCheck(
" day-of-month ,year",
SpreadsheetComparatorNameList.with(
Lists.of(
SpreadsheetComparatorName.DAY_OF_MONTH,
SpreadsheetComparatorName.YEAR
)
)
);
}

@Override
public SpreadsheetComparatorNameList parseString(final String text) {
return SpreadsheetComparatorNameList.parse(text);
}

@Override
public Class<? extends RuntimeException> parseStringFailedExpected(final Class<? extends RuntimeException> thrown) {
return thrown;
}

@Override
public RuntimeException parseStringFailedExpected(final RuntimeException thrown) {
return thrown;
}

// class............................................................................................................

@Override
Expand Down

0 comments on commit d3e4938

Please sign in to comment.