@@ -0,0 +1,2722 @@
+/* Covers test cases for use cases:%0A * 7 , 8%0A * %0A * http://stackoverflow.com/questions/10845937/how-to-do-junit-testing-in-android%0A * Referenced Oct 23, 2013 for general format of Test class%0A * %0A */%0A%0Aimport android.test.ActivityInstrumentationTestCase2;%0Aimport android.widget.TextView;%0A%0Apublic class EditFragmentActivityTestCases extends ActivityInstrumentationTestCase2%3CEditStoryActivity%3E %7B%0A%09//declare activity and widgets%0A%09private EditFragmentActivity myEditFragmentActivity;%0A%09private EditText title;%0A%09private %0A%09%0A%09//Constructor%0A%09public EditStoryActivityTestCases()%7B%0A%09%09super(%22ualberta.g12.adventurecreator.EditFragmentActivity%22, EditFragmentActivity.class);%0A%09%7D%09%0A%09%0A%09//initializes things you want to be set for all tests (not necessary)%0A%09@Override%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A        mActivity = this.getActivity();%0A%09%09Button mbutton = (Button) findViewById(R.id.saveStory)%0A    %7D%0A%0A%09/* Test Cases - all start with %22test%22 */%0A%09%0A%09//Use Case 7, test 1/2%0A%09public void testAddChoiceFragment %7B%0A%09%09%0A%09%09myView = (TextView) myEditFragmentActivity.findViewById(ualberta.g12.adventurecreator.ChooseStoryActivity.R.id.textviewID);%0A%09%09title = %22Test_Choice%22; %0A                String myFragmentId = myView.getText();%0A%09%09Choice myChoice = new Choice(title,myFragmentId);%0A%09%09addChoice(choice));%0A%09%09AssertTrue(myEditFragmentActivity.storyFragments.Choices.get(myFragmentId).equals(myChoice));%0A                %0A%09%7D%0A%09%0A%09//Use Case 7, test 2/2%0A%09public void testMyselfAsChoiceFragment %7B%0A%09%09%0A%09%09%0A%09%09title = %22Test_Choice%22; %0A                String myFragmentId = myEditFragmentActivity.getFragId();%0A%09%09Choice myChoice = new Choice(title,myFragmentId);%0A%09%09addChoice(choice));%0A%09%09AssertTrue(myEditFragmentActivity.storyFragments.Choices.get(myFragmentId).equals(myChoice));%0A                %0A%09%7D%0A%0A%09//Use Case 8, test 1/3%0A%09public void testAddChoiceToEmptyFragment %7B%0A%09%09%0A%09%09StoryFragment EmptySF = new storyFragment;%0A%09%09myEditFragmentActivity.changeStoryFragment(EmptySF);%0A%09%09Choice myChoice = new Choice(%22test%22);%0A%09%09addChoice(choice));%0A%09%09AssertTrue(myEditFragmentActivity.storyFragments.Choices.get(myFragmentId).equals(myChoice));%0A                %0A%09%7D%0A%0A%09//Use Case 8 2/3%0A%09public void testAddChoiceToFragment %7B%0A%09%09%0A%09%09%0A%09%09title = %22Test_Choice%22; %0A                String myFragmentId = myEditFragmentActivity.getFragId(0);%0A%09%09Choice myChoice = new Choice(title,myFragmentId);%0A%09%09addChoice(choice));%0A%09%09AssertTrue(myEditFragmentActivity.storyFragments.Choices.get(myFragmentId).equals(myChoice));%0A                %0A%09%7D%0A%0A%09//Use Case 8, test 3/3%0A%09public void testAddEmptyChoice %7B%0A%09%09Choice emptyChoice = new Choice();%0A%09%09addChoice(new Choice());%0A%09%09AssertTrue(myEditFragmentActivity.storyFragments.Choice.contains(emptyChoice);%0A                %0A%09%7D%0A%0A%7D%0A

Create EditFragmentActivityTestCases.java