use of org.cactoos.matchers.TextHasString in project cactoos by yegor256.
the class AbbreviatedTextTest method abbreviatesTextOneCharBigger.
@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(msg, 17), new TextHasString(msg));
}
use of org.cactoos.matchers.TextHasString in project cactoos by yegor256.
the class RotatedTextTest method noRotateWhenShiftZero.
@Test
public void noRotateWhenShiftZero() {
final String nonrotate = "Cactoos!";
MatcherAssert.assertThat("Rotate text shift zero", new RotatedText(new TextOf(nonrotate), 0), new TextHasString(nonrotate));
}
use of org.cactoos.matchers.TextHasString in project cactoos by yegor256.
the class AbbreviatedTextTest method abbreviatesTextWithWidthBiggerThanLength.
@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(msg, 50), new TextHasString(msg));
}
use of org.cactoos.matchers.TextHasString in project cactoos by yegor256.
the class ReplacedTextTest method notReplaceTextWhenSubstringNotFound.
@Test
public void notReplaceTextWhenSubstringNotFound() {
final String text = "HelloAgain!";
MatcherAssert.assertThat("Replace a text abnormally", new ReplacedText(new TextOf(text), "xyz", "i"), new TextHasString(text));
}
use of org.cactoos.matchers.TextHasString in project cactoos by yegor256.
the class RotatedTextTest method noRotateWhenShiftModZero.
@Test
public void noRotateWhenShiftModZero() {
final String nonrotate = "Rotate";
MatcherAssert.assertThat("Rotate text shift mod zero", new RotatedText(new TextOf(nonrotate), nonrotate.length()), new TextHasString(nonrotate));
}
Aggregations