|
|
|
@ -27,41 +27,42 @@ import static org.junit.Assert.assertEquals; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class DescriptionExtractorTests { |
|
|
|
public class DescriptionExtractorTests { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String NEW_LINE = System.getProperty("line.separator"); |
|
|
|
|
|
|
|
|
|
|
|
private DescriptionExtractor extractor = new DescriptionExtractor(); |
|
|
|
private DescriptionExtractor extractor = new DescriptionExtractor(); |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void extractShortDescription() { |
|
|
|
public void extractShortDescription() { |
|
|
|
assertEquals("My short description.", |
|
|
|
String description = this.extractor.getShortDescription("My short " |
|
|
|
this.extractor.getShortDescription("My short description. More stuff.")); |
|
|
|
+ "description. More stuff."); |
|
|
|
|
|
|
|
assertEquals("My short description.", description); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void extractShortDescriptionNewLineBeforeDot() { |
|
|
|
public void extractShortDescriptionNewLineBeforeDot() { |
|
|
|
assertEquals("My short description.", |
|
|
|
String description = this.extractor.getShortDescription("My short" + NEW_LINE |
|
|
|
this.extractor.getShortDescription("My short" + DescriptionExtractor.NEW_LINE + |
|
|
|
+ "description." + NEW_LINE + "More stuff."); |
|
|
|
"description." + DescriptionExtractor.NEW_LINE + "More stuff.")); |
|
|
|
assertEquals("My short description.", description); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void extractShortDescriptionNewLineBeforeDotWithSpaces() { |
|
|
|
public void extractShortDescriptionNewLineBeforeDotWithSpaces() { |
|
|
|
assertEquals("My short description.", |
|
|
|
String description = this.extractor.getShortDescription("My short " + NEW_LINE |
|
|
|
this.extractor |
|
|
|
+ " description. " + NEW_LINE + "More stuff."); |
|
|
|
.getShortDescription("My short " |
|
|
|
assertEquals("My short description.", description); |
|
|
|
+ DescriptionExtractor.NEW_LINE + " description. " |
|
|
|
|
|
|
|
+ DescriptionExtractor.NEW_LINE + "More stuff.")); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void extractShortDescriptionNoDot() { |
|
|
|
public void extractShortDescriptionNoDot() { |
|
|
|
assertEquals("My short description", |
|
|
|
String description = this.extractor.getShortDescription("My short description"); |
|
|
|
this.extractor.getShortDescription("My short description")); |
|
|
|
assertEquals("My short description", description); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void extractShortDescriptionNoDotMultipleLines() { |
|
|
|
public void extractShortDescriptionNoDotMultipleLines() { |
|
|
|
assertEquals("My short description", |
|
|
|
String description = this.extractor.getShortDescription("My short description " |
|
|
|
this.extractor.getShortDescription("My short description " |
|
|
|
+ NEW_LINE + " More stuff"); |
|
|
|
+ DescriptionExtractor.NEW_LINE + " More stuff")); |
|
|
|
assertEquals("My short description", description); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
|