Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VBM on Android - Initial Appium : Implemented fake network and passin…
…g loadData for MainActivityBridge
- Loading branch information
Showing
7 changed files
with
51 additions
and
40 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
app/src/main/java/com/quantityandconversion/hackernews/MainActivityBridge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package com.quantityandconversion.hackernews; | ||
|
||
class MainActivityBridge { | ||
// private final MainActivity mainActivity; | ||
private final MainActivity mainActivity; | ||
|
||
public MainActivityBridge(final MainActivity mainActivity) { | ||
if(mainActivity == null) throw new IllegalArgumentException("mainActivity cannot be null"); | ||
|
||
// this.mainActivity = mainActivity; | ||
this.mainActivity = mainActivity; | ||
} | ||
|
||
/* package */ void loadData() { | ||
new MainActivityMediator(this).loadItemData(); | ||
} | ||
|
||
|
||
/* package */ void loadedItemData() { | ||
|
||
mainActivity.setTopStoryCount("value"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
app/src/test/java/com/quantityandconversion/hackernews/network/item/ItemAccessTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 4 additions & 9 deletions
13
...est/java/com/quantityandconversion/hackernews/network/item/internal/ItemNetworkTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/src/test/java/com/quantityandconversion/test/MockWebServerTestClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.quantityandconversion.test; | ||
|
||
import com.quantityandconversion.hackernews.network.item.internal.ItemNetworkTestResponses; | ||
|
||
import org.junit.Before; | ||
import org.junit.Rule; | ||
|
||
import okhttp3.mockwebserver.MockWebServer; | ||
|
||
public class MockWebServerTestClass { | ||
@Rule | ||
public final MockWebServer mockWebServer = new MockWebServer(); | ||
|
||
protected ItemNetworkTestResponses itemNetworkTestResponses; | ||
@Before | ||
public void setup(){ | ||
itemNetworkTestResponses = new ItemNetworkTestResponses(); | ||
} | ||
} |