-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from OpenSRP/tt-wk4-JsonFormFragmentPresenter…
…Test TT Week 4 Json Form Fragment Presenter unit tests
- Loading branch information
Showing
8 changed files
with
145 additions
and
23 deletions.
There are no files selected for viewing
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
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
20 changes: 20 additions & 0 deletions
20
android-json-form-wizard/src/test/java/com/vijay/jsonwizard/shadow/ShadowContextCompat.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,20 @@ | ||
package com.vijay.jsonwizard.shadow; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.content.ContextCompat; | ||
|
||
import org.robolectric.annotation.Implementation; | ||
import org.robolectric.annotation.Implements; | ||
|
||
/** | ||
* Created by samuelgithengi on 3/17/20. | ||
*/ | ||
@Implements(ContextCompat.class) | ||
public class ShadowContextCompat { | ||
|
||
@Implementation | ||
public static int checkSelfPermission(@NonNull Context context, @NonNull String permission){ | ||
return 1; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...oid-json-form-wizard/src/test/java/com/vijay/jsonwizard/shadow/ShadowPermissionUtils.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,20 @@ | ||
package com.vijay.jsonwizard.shadow; | ||
|
||
import android.support.v4.app.Fragment; | ||
|
||
import com.vijay.jsonwizard.utils.PermissionUtils; | ||
|
||
import org.robolectric.annotation.Implementation; | ||
import org.robolectric.annotation.Implements; | ||
|
||
/** | ||
* Created by samuelgithengi on 3/17/20. | ||
*/ | ||
@Implements(PermissionUtils.class) | ||
public class ShadowPermissionUtils { | ||
|
||
@Implementation | ||
public static boolean isPermissionGranted(Fragment fragment, String[] permissions, int requestCode){ | ||
return true; | ||
} | ||
} |
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