package com.cwainner.chris.recipecentral;

import android.os.Build;
import android.widget.TextView;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

import static org.junit.Assert.*;

@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP)
@RunWith(RobolectricGradleTestRunner.class)

public class MainActivityTest {
    private MainActivity activity;

    @Before
    public void setup(){
        activity = Robolectric.setupActivity(MainActivity.class);
    }

    @Test
    public void validateMainHeader(){
        TextView appNameTextView = (TextView) activity.findViewById(R.id.mainHeader);
        assertTrue("Welcome to Recipe Central!".equals(appNameTextView.getText().toString()));
    }
}

@@ -36,16 +36,47 @@
 ntral;%0A%0A
+import android.content.Intent;%0A
 import a
@@ -92,16 +92,16 @@
 .Build;%0A
-
 import a
@@ -335,16 +335,63 @@
 .Config;
+%0Aimport org.robolectric.shadows.ShadowActivity;
 %0A%0Aimport
@@ -851,16 +851,16 @@
 eader);%0A
-
         
@@ -951,11 +951,845 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void aboutActivityStarted()%7B%0A        activity.findViewById(R.id.aboutButton).performClick();%0A        Intent expectedIntent = new Intent(activity, AboutActivity.class);%0A        ShadowActivity shadowActivity = org.robolectric.Shadows.shadowOf(activity);%0A        Intent actualIntent = shadowActivity.getNextStartedActivity();%0A        assertTrue(actualIntent.filterEquals(expectedIntent));%0A    %7D%0A%0A    @Test%0A    public void contactActivityStarted()%7B%0A        activity.findViewById(R.id.contactButton).performClick();%0A        Intent expectedIntent = new Intent(activity, ContactActivity.class);%0A        ShadowActivity shadowActivity = org.robolectric.Shadows.shadowOf(activity);%0A        Intent actualIntent = shadowActivity.getNextStartedActivity();%0A        assertTrue(actualIntent.filterEquals(expectedIntent));%0A    %7D
 %0A%7D%0A

Add tests for main page about and contact buttons