package com.example.qyu4.theallswap;

import android.test.ActivityInstrumentationTestCase2;

/**
 * Created by qyu4 on 10/7/15.
 */
public class UserOfflineTradingTest extends ActivityInstrumentationTestCase2 {
    UserOfflineTradingTest(){
        super(UserTradingActivity.class);
    }

}

@@ -282,11 +282,1987 @@
 ;%0A    %7D%0A
+    /**%0A     * testCreateTradeOffline is related to use cases #3%0A     **/%0A    public void testCreateTradeOffline()%7B%0A        ArrayList%3CTrade%3E tradeList = new ArrayList%3CTrade%3E();%0A        //TODO: creating item offline;%0A        Trade tradeOffline = new Trade(%22offline Trade%22, %22offer item description%22);%0A        itemList.add(tradeOffline);%0A        assertEqual(%22offline Trade%22, String.vavlueOf(tradeList.getItemIndex(0)))%0A        //TODO: get result while online%0A        //TODO: check if new result and item created when offline is equal.%0A        assertEqual(%22offline Trade%22, trade.getName(0));%0A    %7D%0A    /**%0A     * testCreateTradeOfflinePushed is related to use cases #4%0A     **/%0A    public void testCreateTradeOfflinePushed()%7B%0A        InternetConnection ic = new InternetConnection();%0A        ic.setInternet(false);%0A        assertTrue(testIsOffline());%0A        ArrayList%3CTrade%3E tradeList = new ArrayList%3CTrade%3E();%0A        //TODO: creating item offline;%0A        Trade tradeOffline = new Trade(%22offline Trade%22, %22offer item description%22);%0A        tradeList.add(tradeOffline);%0A        ic.setInternet(true);%0A        assertTrue(testIsOnline());%0A        //TODO: get result while online%0A        //and load the result item into itemList %0A        CreateTradeOffer.loadFile(tradeList);%0A        %0A        assertEqual(%22offline Trade%22, String.vavlueOf(tradeList.getItemIndex(0)));%0A        //TODO: check if new result and item created when offline is equal.%0A        assertEqual(%22offline Trade%22, trade.getName(0));%0A        %0A        //TODO: reconnect internet;%0A       %0A        //TODO: initialize a item name(string Type: itemName)%0A        //TODO: create an item setName(itemNam)%0A        //assertEquals(item.getName().equals(String));%0A    %7D%0A    public boolean testIsOffline()%7B%0A        boolean cantConnect = NetworkConnector.tryConnect(); %0A        return not canConnect;%0A    %7D%0A    public boolean testIsOnline()%7B%0A        boolean canConnect = NetworkConnector.tryConnect(); %0A        return true;%0A    %7D%0A%0A
 %0A%7D%0A

Update UserOfflineTradingTest.java