use of org.cactoos.Text in project cactoos by yegor256.
the class BytesOfTest method asBytes.
@Test
void asBytes() throws Exception {
final Text text = new TextOf("Hello!");
new Assertion<>("Can't convert text into bytes", new BytesOf(new InputOf(text)).asBytes(), new IsEqual<>(new BytesOf(text.asString()).asBytes())).affirm();
}
use of org.cactoos.Text in project cactoos by yegor256.
the class UncheckedTextTest method equalsToTheSameTextObject.
@Test
void equalsToTheSameTextObject() {
final Text text = new TextOf("anything");
new Assertion<>("Must match text representing the same value", new UncheckedText(text), new IsEqual<>(text)).affirm();
}
use of org.cactoos.Text in project cactoos by yegor256.
the class SplitTest method splitTextWithTextRegexAndLimit.
@Test
void splitTextWithTextRegexAndLimit() throws Exception {
final Text txt = new TextOf("Split!# #OOP");
new Assertion<>("Must split text with text regex and limit", new Split(txt, "\\W+", 1), new IsEqual<>(new IterableOf<>(txt))).affirm();
}
use of org.cactoos.Text in project cactoos by yegor256.
the class StickyTest method equalsItself.
@Test
void equalsItself() {
final Text random = new Randomized();
final Text sticky = new Sticky(random);
new Assertion<>("must be the same as itself", sticky, new AllOf<Text>(new IsEqual<>(sticky), new IsNot<>(new IsEqual<>(random)))).affirm();
}
use of org.cactoos.Text in project cactoos by yegor256.
the class StickyTest method cachesResult.
@Test
void cachesResult() {
final Text sticky = new Sticky(new Randomized());
new Assertion<>("must be the same", sticky, new IsText(sticky)).affirm();
}
Aggregations