package com.android21buttons.fragmenttestrule;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;

import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;

public class FragmentTestRuleTest {
    @Before
    public void setUp() throws Exception {

    }

    @Test
    public void createFragment() throws Exception {
        FragmentTestRule<?, Fragment> testRule = new FragmentTestRule<>(FragmentActivity.class, Fragment.class);

        assertThat(testRule.createFragment(), is(notNullValue()));
    }

    @Test
    public void getFragmentCreate() throws Exception {
        FragmentTestRule<?, Fragment> testRule = new FragmentTestRule<>(FragmentActivity.class, Fragment.class);

        final Fragment fragment = testRule.createFragment();
        assertThat(testRule.getFragment(), is(fragment));
    }

    @Test
    public void getFragmentNoCreate() throws Exception {
        FragmentTestRule<?, Fragment> testRule = new FragmentTestRule<>(FragmentActivity.class, Fragment.class);

        assertThat(testRule.getFragment(), is(nullValue()));
    }
}

@@ -134,33 +134,8 @@
 y;%0A%0A
-import org.junit.Before;%0A
 impo
@@ -153,16 +153,16 @@
 t.Test;%0A
+
 %0Aimport 
@@ -396,70 +396,8 @@
 st %7B
-%0A    @Before%0A    public void setUp() throws Exception %7B%0A%0A    %7D
 %0A%0A  
@@ -562,32 +562,32 @@
 agment.class);%0A%0A
+
         assertTh
@@ -648,313 +648,8 @@
  %7D%0A%0A
-    @Test%0A    public void getFragmentCreate() throws Exception %7B%0A        FragmentTestRule%3C?, Fragment%3E testRule = new FragmentTestRule%3C%3E(FragmentActivity.class, Fragment.class);%0A%0A        final Fragment fragment = testRule.createFragment();%0A        assertThat(testRule.getFragment(), is(fragment));%0A    %7D%0A%0A
     

Fix tests