use of org.llorllale.cactoos.matchers.HasString in project cactoos by yegor256.
the class LoggingInputTest method logMarkSupportedFromLargeTextFile.
@Test
void logMarkSupportedFromLargeTextFile() throws Exception {
final Logger logger = new FakeLogger();
new LoggingInput(new ResourceOf("org/cactoos/large-text.txt"), "text file", logger).stream().markSupported();
new Assertion<>("Must log mark and reset are not supported from text file", new TextOf(logger.toString()), new HasString("Mark and reset are supported from text file")).affirm();
}
use of org.llorllale.cactoos.matchers.HasString in project cactoos by yegor256.
the class LoggingInputTest method logAvailableFromLargeTextFile.
@Test
void logAvailableFromLargeTextFile() throws Exception {
final Logger logger = new FakeLogger();
new LoggingInput(new ResourceOf("org/cactoos/large-text.txt"), "text file", logger).stream().available();
new Assertion<>("Must log avaliable byte(s) from text file", new TextOf(logger.toString()), new HasString("There is(are) 74536 byte(s) available from text file")).affirm();
}
use of org.llorllale.cactoos.matchers.HasString in project cactoos by yegor256.
the class ReplacedTest method notReplaceTextWhenSubstringNotFound.
@Test
void notReplaceTextWhenSubstringNotFound() {
final String text = "HelloAgain!";
new Assertion<>("Replace a text abnormally", new Replaced(new TextOf(text), "xyz", "i"), new HasString(text)).affirm();
}
use of org.llorllale.cactoos.matchers.HasString in project cactoos by yegor256.
the class RotatedTest method noRotateWhenShiftModZero.
@Test
void noRotateWhenShiftModZero() {
final String nonrotate = "Rotate";
new Assertion<>("Rotate text shift mod zero", new Rotated(new TextOf(nonrotate), nonrotate.length()), new HasString(nonrotate)).affirm();
}
Aggregations