package com.example.qyu4.theallswap;

import android.test.ActivityInstrumentationTestCase2;

/**
 * Created by qyu4 on 10/7/15.
 * this is the test file for testing user offline activities.
 * At the date Oct. 7th, 2015, this file is just a skeleton testfile and it does not
 * have it real functionality.
 */
public class OfflineUserActivityTest extends ActivityInstrumentationTestCase2 {
    public OfflineUserActivityTest(){
        super(UserEditInventoryActivity.class);
    }
    public void testNewItemCreated(){
        assertTrue(testIsOffline());
        //TODO: creating item offline;
        //TODO: reconnect internet;
        assertTrue(testIsOnline());
        //TODO: get result while online
        //TODO: check if new result and item created when offline is equal.

    }
    public void testAddItem(){
        //TODO: initialize a item name(string Type: itemName)
        //TODO: create an item setName(itemNam)
        //assertEquals(item.getName().equals(String));
    }
    public boolean testIsOffline(){
        return true;
    }
    public boolean testIsOnline(){
        return true;
    }

}

@@ -509,24 +509,82 @@
 mCreated()%7B%0A
+        ArrayList%3CItem%3E itemList = new ArrayList%3CItem%3E();%0A
         asse
@@ -647,16 +647,144 @@
 ffline;%0A
+        Item itemOffline = new Item(%22offline item%22, %22category%22, %22offline item description%22);%0A        itemList.add(itemOffline);%0A
         
@@ -963,16 +963,69 @@
  equal.%0A
+        assertEqual(%22offline item%22, item.getName(0));
 %0A    %7D%0A 
@@ -1273,61 +1273,194 @@
     
-return true;%0A    %7D%0A    public boolean testIsOnline()%7B
+boolean cantConnect = NetworkConnector.tryConnect(); %0A        return not canConnect;%0A    %7D%0A    public boolean testIsOnline()%7B%0A        boolean canConnect = NetworkConnector.tryConnect(); 
 %0A   

Update OfflineUserActivityTest.java