package ru.job4j.io;

import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

/**
 * Class RemoveForbiddenWordsTest.
 *
 * @author Ponkin Aleksey
 * @version 1.0.0
 * @since 23.01.2019.
 */
public class RemoveForbiddenWordsTest {

    /**
     * Test when contains one abuse word in text.
     */
    @Test
    public void whenTextContainsOneAbuseWord() {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteArrayInputStream in = new ByteArrayInputStream("Test text with one abuse word".getBytes());
        String[] abuse = new String[] {"abuse"};
        new RemoveForbiddenWords().dropAbuse(in, out, abuse);
        assertThat(out.toString(), is("Test text with one  word\r\n"));
    }

    /**
     * Test when contains two abuse word in text.
     */
    @Test
    public void whenTextContainsTwoAbuseWord() {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteArrayInputStream in = new ByteArrayInputStream("Test text with one abuse.\n One bad word.".getBytes());
        String[] abuse = new String[] {"abuse", "bad"};
        new RemoveForbiddenWords().dropAbuse(in, out, abuse);
        assertThat(out.toString(), is("Test text with one .\r\n One  word.\r\n"));
    }
}
@@ -350,16 +350,103 @@
 dsTest %7B
+%0A    private static final String LINE_SEPARATOR = System.getProperty(%22line.separator%22);
 %0A%0A    /*
@@ -907,21 +907,34 @@
 ne  word
-%5Cr%5Cn%22
+%22 + LINE_SEPARATOR
 ));%0A    
@@ -1423,28 +1423,59 @@
 ne .
-%5Cr%5Cn One  word.%5Cr%5Cn%22
+%22 + LINE_SEPARATOR + %22 One  word.%22 + LINE_SEPARATOR
 ));%0A

Add LINE_SEPARATOR.