-
Notifications
You must be signed in to change notification settings - Fork 22
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 #90 from uphold/feature/add-documents-endpoint
Add support for the documents endpoint
- Loading branch information
Showing
11 changed files
with
398 additions
and
8 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
35 changes: 35 additions & 0 deletions
35
...t/java/com/uphold/uphold_android_sdk/test/integration/model/user/DocumentRequestTest.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,35 @@ | ||
package com.uphold.uphold_android_sdk.test.integration.model.user; | ||
|
||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.suitebuilder.annotation.SmallTest; | ||
|
||
import com.uphold.uphold_android_sdk.model.user.DocumentRequest; | ||
|
||
import junit.framework.Assert; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* DocumentRequest integration tests. | ||
*/ | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@SmallTest | ||
public class DocumentRequestTest { | ||
|
||
@Test | ||
public void getTypeShouldReturnTheType() { | ||
DocumentRequest documentRequest = new DocumentRequest("foo", "bar"); | ||
|
||
Assert.assertEquals(documentRequest.getType(), "foo"); | ||
} | ||
|
||
@Test | ||
public void getValueShouldReturnTheValue() { | ||
DocumentRequest documentRequest = new DocumentRequest("foo", "bar"); | ||
|
||
Assert.assertEquals(documentRequest.getValue(), "bar"); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...roidTest/java/com/uphold/uphold_android_sdk/test/integration/model/user/DocumentTest.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,35 @@ | ||
package com.uphold.uphold_android_sdk.test.integration.model.user; | ||
|
||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.suitebuilder.annotation.SmallTest; | ||
|
||
import com.uphold.uphold_android_sdk.model.user.Document; | ||
|
||
import junit.framework.Assert; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Document integration tests. | ||
*/ | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@SmallTest | ||
public class DocumentTest { | ||
|
||
@Test | ||
public void getTypeShouldReturnTheType() { | ||
Document document = new Document("foo", "bar"); | ||
|
||
Assert.assertEquals(document.getType(), "foo"); | ||
} | ||
|
||
@Test | ||
public void getValueShouldReturnTheValue() { | ||
Document document = new Document("foo", "bar"); | ||
|
||
Assert.assertEquals(document.getValue(), "bar"); | ||
} | ||
|
||
} |
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
46 changes: 46 additions & 0 deletions
46
src/app/src/main/java/com/uphold/uphold_android_sdk/model/user/Document.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,46 @@ | ||
package com.uphold.uphold_android_sdk.model.user; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Document model. | ||
*/ | ||
|
||
public class Document implements Serializable { | ||
|
||
private final String type; | ||
private final String value; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param type The document type. | ||
* @param value The document value. | ||
*/ | ||
|
||
public Document(String type, String value) { | ||
this.type = type; | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* Gets the document type. | ||
* | ||
* @return the document type. | ||
*/ | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* Gets the document value. | ||
* | ||
* @return the document value. | ||
*/ | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
} |
Oops, something went wrong.