use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromCharSequenceTest method copiesFromCharSequenceWithCharsetByNameToFile.
@Test
public void copiesFromCharSequenceWithCharsetByNameToFile() throws Exception {
final String input = "Hello, товарищ file #3 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input, output, StandardCharsets.UTF_8.name())).value();
new Assertion<>("char sequence must be copied to the file with UTF_8 charset's name", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromCharSequenceTest method copiesFromCharSequenceToOutput.
@Test
public void copiesFromCharSequenceToOutput() throws Exception {
final String input = "Hello, товарищ output #1 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input, new OutputTo(output))).value();
new Assertion<>("char sequence must be copied to the output", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromCharSequenceTest method copiesFromCharSequenceWithCharsetToOutput.
@Test
public void copiesFromCharSequenceWithCharsetToOutput() throws Exception {
final String input = "Hello, товарищ output #2 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input, new OutputTo(output), StandardCharsets.UTF_8)).value();
new Assertion<>("char sequence must be copied to the output with UTF_8 charset", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromCharSequenceTest method copiesFromCharSequenceWithCharsetToFile.
@Test
public void copiesFromCharSequenceWithCharsetToFile() throws Exception {
final String input = "Hello, товарищ file #2 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input, output, StandardCharsets.UTF_8)).value();
new Assertion<>("char sequence must be copied to the file with UTF_8 charset", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromCharSequenceTest method copiesFromCharSequenceWithCharsetByNameToPath.
@Test
public void copiesFromCharSequenceWithCharsetByNameToPath() throws Exception {
final String input = "Hello, товарищ path #3 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input, output.toPath(), StandardCharsets.UTF_8.name())).value();
new Assertion<>("char sequence must be copied to the path with UTF_8 charset's name", new InputOf(output), new HasContent(input)).affirm();
}
Aggregations