-
Notifications
You must be signed in to change notification settings - Fork 93
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
Showing
22 changed files
with
629 additions
and
512 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
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,8 @@ | ||
module common { | ||
|
||
requires de.siegmar.fastcsv; | ||
requires org.assertj.core; | ||
|
||
exports testutil; | ||
|
||
} |
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,55 @@ | ||
package testutil; | ||
|
||
import org.assertj.core.api.AbstractAssert; | ||
import org.assertj.core.api.InstanceOfAssertFactory; | ||
import org.assertj.core.api.ListAssert; | ||
|
||
import de.siegmar.fastcsv.reader.CsvRow; | ||
|
||
public class CsvRowAssert extends AbstractAssert<CsvRowAssert, CsvRow> { | ||
|
||
public static final InstanceOfAssertFactory<CsvRow, CsvRowAssert> CSV_ROW = | ||
new InstanceOfAssertFactory<>(CsvRow.class, CsvRowAssert::assertThat); | ||
|
||
protected CsvRowAssert(final CsvRow actual) { | ||
super(actual, CsvRowAssert.class); | ||
} | ||
|
||
public static CsvRowAssert assertThat(final CsvRow actual) { | ||
return new CsvRowAssert(actual); | ||
} | ||
|
||
public CsvRowAssert isOriginalLineNumber(final long originalLineNumber) { | ||
isNotNull(); | ||
if (actual.getOriginalLineNumber() != originalLineNumber) { | ||
failWithMessage("Expected original line number to be <%d> but was <%d>", | ||
originalLineNumber, actual.getOriginalLineNumber()); | ||
} | ||
|
||
return this; | ||
} | ||
|
||
public CsvRowAssert isComment(final boolean comment) { | ||
isNotNull(); | ||
if (actual.isComment() != comment) { | ||
failWithMessage("Expected comment to be <%b> but was <%b>", | ||
comment, actual.isComment()); | ||
} | ||
|
||
return this; | ||
} | ||
|
||
public CsvRowAssert isComment() { | ||
return isComment(true); | ||
} | ||
|
||
public CsvRowAssert isNotComment() { | ||
return isComment(false); | ||
} | ||
|
||
public ListAssert<String> fields() { | ||
isNotNull(); | ||
return new ListAssert<>(actual.getFields()); | ||
} | ||
|
||
} |
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,43 @@ | ||
package testutil; | ||
|
||
import org.assertj.core.api.AbstractAssert; | ||
import org.assertj.core.api.InstanceOfAssertFactory; | ||
import org.assertj.core.api.MapAssert; | ||
import org.assertj.core.api.StringAssert; | ||
|
||
import de.siegmar.fastcsv.reader.NamedCsvRow; | ||
|
||
public class NamedCsvRowAssert extends AbstractAssert<NamedCsvRowAssert, NamedCsvRow> { | ||
|
||
public static final InstanceOfAssertFactory<NamedCsvRow, NamedCsvRowAssert> NAMED_CSV_ROW = | ||
new InstanceOfAssertFactory<>(NamedCsvRow.class, NamedCsvRowAssert::assertThat); | ||
|
||
protected NamedCsvRowAssert(final NamedCsvRow actual) { | ||
super(actual, NamedCsvRowAssert.class); | ||
} | ||
|
||
public static NamedCsvRowAssert assertThat(final NamedCsvRow actual) { | ||
return new NamedCsvRowAssert(actual); | ||
} | ||
|
||
public NamedCsvRowAssert isOriginalLineNumber(final long originalLineNumber) { | ||
isNotNull(); | ||
if (actual.getOriginalLineNumber() != originalLineNumber) { | ||
failWithMessage("Expected original line number to be <%d> but was <%d>", | ||
originalLineNumber, actual.getOriginalLineNumber()); | ||
} | ||
|
||
return this; | ||
} | ||
|
||
public MapAssert<String, String> fields() { | ||
isNotNull(); | ||
return new MapAssert<>(actual.getFields()); | ||
} | ||
|
||
public StringAssert field(final String name) { | ||
isNotNull(); | ||
return new StringAssert(actual.getField(name)); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.