Skip to content

Commit

Permalink
Enhance test case to check line number of the error
Browse files Browse the repository at this point in the history
  • Loading branch information
takahi-i committed Apr 21, 2018
1 parent 31d1e45 commit da5ee0d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ void testDocument() throws RedPenException {
.build();

RedPen redPen = new RedPen(config);
Map<Document, List<ValidationError>> errors = redPen.validate(documents);
assertEquals(1, errors.get(documents.get(0)).size());
List<ValidationError> errors = redPen.validate(documents).get(documents.get(0));
assertEquals(1, errors.size());
assertEquals(2, errors.get(0).getLineNumber());
}

@Test
void testSimpleSentence() throws Exception {
List<Document> documents = new ArrayList<>();documents.add(
List<Document> documents = new ArrayList<>();
documents.add(
Document.builder()
.addSection(1)
.addParagraph()
Expand All @@ -70,8 +72,8 @@ void testSimpleSentence() throws Exception {

Configuration config;
config = Configuration.builder()
.addValidatorConfig(new ValidatorConfiguration("UnexpandedAcronym"))
.build();
.addValidatorConfig(new ValidatorConfiguration("UnexpandedAcronym"))
.build();

RedPen redPen = new RedPen(config);
Map<Document, List<ValidationError>> errors = redPen.validate(documents);
Expand Down

0 comments on commit da5ee0d

Please sign in to comment.