package ru.matevosyan;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

/**
 * For testing Stack class.
 * Created on 25.05.2017.
 * @author Matevosyan Vardan
 * @version 1.0
 */
public class StackTest {
    @Test
    public void whenAddToTheStackAndPeekThanCheckAddedAndPeekedElement() {
        Stack<Integer> stack = new Stack<>();

        int a = stack.push(3);
        int b = stack.push(2);

        int peek = stack.peek();

        assertThat(a, is(3));
        assertThat(peek, is(b));
    }

    @Test
    public void whenAddToTheStackAndPopThanCheckAddedAndPopElement() {
        Stack<Integer> stack = new Stack<>();

        int a = stack.push(3);
        int b = stack.push(2);

        int peek = stack.peek();

        int pop = stack.pop();

        int peekAfterPop = stack.peek();
        assertThat(a, is(3));
        assertThat(peek, is(b));
        assertThat(peekAfterPop, is(3));
        assertThat(pop, is(2));

    }

}
@@ -266,16 +266,174 @@
 kTest %7B%0A
+%0A    /**%0A     * Create whenAddToTheStackAndPeekThanCheckAddedAndPeekedElement() to test %7B@link Stack#push(Object)%7D.%0A     * and %7B@link Stack#peek()%7D.%0A     */%0A%0A
     @Tes
@@ -723,16 +723,169 @@
 %0A    %7D%0A%0A
+    /**%0A     * Create whenAddToTheStackAndPopThanCheckAddedAndPopElement() to test %7B@link Stack#push(Object)%7D.%0A     * and %7B@link Stack#pop()%7D%7D.%0A     */%0A%0A
     @Tes

add javadoc