package ru.job4j.test;

import org.junit.Test;
import static org.junit.Assert.assertThat;
import static org.hamcrest.core.Is.is;
/**
 *Tests for BubbleSort class.
 *@author Prokopov Artem
 *@since 30.03.2017
 *@version 1.0
 */
public class ContainsStringTest {
    /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "t str".
     *The exepted result is true.
     */
    @Test
    public void whenStringTestStringAndTStrThenTrue() {
        String originString = "Test string";
	String subString = "t str";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = true;
	assertThat(result, is(expected));
    }
     /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "ings".
     *The exepted result is false.
     */
    @Test
    public void whenStringTestStringAndIngsThenFalse() {
        String originString = "Test string";
	String subString = "ings";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = false;
	assertThat(result, is(expected));
    }
    /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "Test strings".
     *The exepted result is false.
     */
    @Test
    public void whenStringTestStringAndTestStringsThenFalse() {
        String originString = "Test string";
	String subString = "Test strings";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = false;
	assertThat(result, is(expected));
    }
    /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "Test".
     *The exepted result is true.
     */
    @Test
    public void whenStringTestStringAndTestThenTrue() {
        String originString = "Test string";
	String subString = "Test";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = true;
	assertThat(result, is(expected));
    }
     /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "ing".
     *The exepted result is true.
     */
    @Test
    public void whenStringTestStringAndIngThenTrue() {
        String originString = "Test string";
	String subString = "ing";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = true;
	assertThat(result, is(expected));
    }
     /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "Test string".
     *The exepted result is true.
     */
    @Test
    public void whenStringTestStringAndTestStringThenTrue() {
        String originString = "Test string";
	String subString = "Test string";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = true;
	assertThat(result, is(expected));
    }
     /**
     *Test for method "contains".
     *Test the checks whether a string is a substring of the given string, "Test string" and "1Test strings".
     *The exepted result is false.
     */
    @Test
    public void whenStringTestStringAnd1TestStringsThenFalse() {
        String originString = "Test string";
	String subString = "1Test strings";
	ContainsString contain = new ContainsString();
        boolean result = contain.contains(originString, subString);
        boolean expected = false;
	assertThat(result, is(expected));
    }
}

@@ -3933,10 +3933,518 @@
 ;%0A    %7D%0A
+     /**%0A     *Test for method %22contains%22.%0A     *Test the checks whether a string is a substring of the given string, %22bbaabbbaa%22 and %22bbb%22.%0A     *The exepted result is false.%0A     */%0A    @Test%0A    public void whenStringBbaabbbaaAndBbbThenTrue() %7B%0A        String originString = %22bbaabbbaa%22;%0A%09String subString = %22bbb%22;%0A%09ContainsString contain = new ContainsString();%0A        boolean result = contain.contains(originString, subString);%0A        boolean expected = true;%0A%09assertThat(result, is(expected));%0A    %7D%0A
 %7D%0A

task 228