package fr.paris10.projet.assogenda.assogenda.ui.fragment;

import android.support.test.espresso.intent.rule.IntentsTestRule;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import fr.paris10.projet.assogenda.assogenda.R;
import fr.paris10.projet.assogenda.assogenda.ui.activites.AssociationDashboardActivity;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.*;

public class AssociationMainFragmentTest {

    @Rule
    public IntentsTestRule<AssociationDashboardActivity> mActivityRule = new IntentsTestRule<>(AssociationDashboardActivity.class);

    @Before
    public void setUp() throws Exception {

    }

    @After
    public void tearDown() throws Exception {

    }

    @Test
    public void testCreateAssociationButton() {

        onView(withId(R.id.fragment_association_main_button_create_association)).check(matches(notNullValue() ));
        onView(withId(R.id.fragment_association_main_button_create_association)).perform(click());
        onView(withId(R.id.fragment_create_association_name_title))
                .check(matches(withText((R.string.fragment_create_association_name_title))));
    }
}
@@ -64,298 +64,71 @@
 ort 
-android.support.test.espresso.intent.rule.IntentsTestRule;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport fr.paris10.projet.assogenda.assogenda.R;%0Aimport fr.paris10.projet.assogenda.assogenda.ui.activites.AssociationDashboardActivity
+org.junit.Test;%0A%0Aimport fr.paris10.projet.assogenda.assogenda.R
 ;%0A%0Ai
@@ -536,42 +536,8 @@
 lue;
-%0Aimport static org.junit.Assert.*;
 %0A%0Apu
@@ -582,279 +582,8 @@
  %7B%0A%0A
-    @Rule%0A    public IntentsTestRule%3CAssociationDashboardActivity%3E mActivityRule = new IntentsTestRule%3C%3E(AssociationDashboardActivity.class);%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A%0A    %7D%0A%0A
     

refactor (Association) : refactor test association