Skip to content

Commit

Permalink
#198 removed duplicated literals
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciofx committed Jan 26, 2018
1 parent 04805e5 commit a835a57
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/test/java/org/cactoos/text/AbbreviatedTextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,17 @@
* @since 0.29
* @checkstyle JavadocMethodCheck (500 lines)
*/
@SuppressWarnings(
{
"PMD.AvoidDuplicateLiterals",
"PMD.TooManyMethods"
}
)
@SuppressWarnings("PMD.TooManyMethods")
public final class AbbreviatedTextTest {

@Test
public void abbreviatesAnEmptyText() {
final String msg = "";
MatcherAssert.assertThat(
"Can't abbreviate an empty text",
"Can't abbreviate an msg text",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("", 8),
new TextHasString("")
new AbbreviatedText(msg, 8),
new TextHasString(msg)
);
}

Expand All @@ -74,41 +70,45 @@ public void abbreviatesTextOneCharSmaller() {

@Test
public void abbreviatesTextWithSameLength() {
final String msg = "elegant objects";
MatcherAssert.assertThat(
"Can't abbreviate a text with same length",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("elegant objects", 15),
new TextHasString("elegant objects")
new AbbreviatedText(msg, 15),
new TextHasString(msg)
);
}

@Test
public void abbreviatesTextOneCharBigger() {
final String msg = "the old mcdonald";
MatcherAssert.assertThat(
"Can't abbreviate a text one char bigger",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("the old mcdonald", 17),
new TextHasString("the old mcdonald")
new AbbreviatedText(msg, 17),
new TextHasString(msg)
);
}

@Test
public void abbreviatesTextTwoCharsBigger() {
final String msg = "hi everybody!";
MatcherAssert.assertThat(
"Can't abbreviate a text two chars bigger",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("elegant objects", 17),
new TextHasString("elegant objects")
new AbbreviatedText(msg, 15),
new TextHasString(msg)
);
}

@Test
public void abbreviatesTextWithWidthBiggerThanLength() {
final String msg = "cactoos framework";
MatcherAssert.assertThat(
"Can't abbreviate a text with width bigger than length",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("cactoos framework", 50),
new TextHasString("cactoos framework")
new AbbreviatedText(msg, 50),
new TextHasString(msg)
);
}

Expand Down

0 comments on commit a835a57

Please sign in to comment.