// Path: matcher-decorators/src/main/java/ru/yandex/qatools/matchers/decorators/MatcherDecoratorsBuilder.java
// @Factory
// public static <T> MatcherDecoratorsBuilder<T> should(final Matcher<? super T> matcher) {
//     return new MatcherDecoratorsBuilder<T>(matcher);
// }
// 
// Path: webdriver-matchers/src/main/java/ru/yandex/qatools/matchers/webdriver/RefreshPageAction.java
// public static RefreshPageAction pageRefresh(final WebDriver driver) {
//     return new RefreshPageAction(driver);
// }


import org.hamcrest.Matcher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.openqa.selenium.WebDriver;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.*;
import static org.openqa.selenium.WebDriver.Navigation;
import static ru.yandex.qatools.matchers.decorators.MatcherDecoratorsBuilder.should;
import static ru.yandex.qatools.matchers.webdriver.RefreshPageAction.pageRefresh;
package ru.yandex.qatools.matchers.webdriver;



/**
 * Created with IntelliJ IDEA.
 * User: lanwen
 * Date: 12.02.13
 * Time: 0:08
 */
@RunWith(MockitoJUnitRunner.class)
public class RefreshPageMatcherDecoratorTest {
    public static final boolean THE_OBJECT = true;
    public static final boolean NOT_SAME_OBJECT = false;

    @Mock
    private WebDriver driver;
    @Mock
    private Navigation navigation;
    @Mock
    private Matcher<Object> matcher;

    @Test(expected = AssertionError.class)
    public void decoratedMatcherShouldNotMatchDifferentObjects() {
        when(driver.navigate()).thenReturn(navigation);

// Path: matcher-decorators/src/main/java/ru/yandex/qatools/matchers/decorators/MatcherDecoratorsBuilder.java
// @Factory
// public static <T> MatcherDecoratorsBuilder<T> should(final Matcher<? super T> matcher) {
//     return new MatcherDecoratorsBuilder<T>(matcher);
// }
// 
// Path: webdriver-matchers/src/main/java/ru/yandex/qatools/matchers/webdriver/RefreshPageAction.java
// public static RefreshPageAction pageRefresh(final WebDriver driver) {
//     return new RefreshPageAction(driver);
// }


// Path: webdriver-matchers/src/test/java/ru/yandex/qatools/matchers/webdriver/RefreshPageMatcherDecoratorTest.java
import org.hamcrest.Matcher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.openqa.selenium.WebDriver;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.*;
import static org.openqa.selenium.WebDriver.Navigation;
import static ru.yandex.qatools.matchers.decorators.MatcherDecoratorsBuilder.should;
import static ru.yandex.qatools.matchers.webdriver.RefreshPageAction.pageRefresh;

package ru.yandex.qatools.matchers.webdriver;



/**
 * Created with IntelliJ IDEA.
 * User: lanwen
 * Date: 12.02.13
 * Time: 0:08
 */
@RunWith(MockitoJUnitRunner.class)
public class RefreshPageMatcherDecoratorTest {
    public static final boolean THE_OBJECT = true;
    public static final boolean NOT_SAME_OBJECT = false;

    @Mock
    private WebDriver driver;
    @Mock
    private Navigation navigation;
    @Mock
    private Matcher<Object> matcher;

    @Test(expected = AssertionError.class)
    public void decoratedMatcherShouldNotMatchDifferentObjects() {
        when(driver.navigate()).thenReturn(navigation);

        assertThat(THE_OBJECT, should(is(NOT_SAME_OBJECT)).after(pageRefresh(driver)));