This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
1,890 additions
and
733 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 was deleted.
Oops, something went wrong.
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
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,17 +1,3 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/cattaneostefano/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
-dontwarn it.near.sdk.** | ||
-keep class it.near.sdk.** { *; } | ||
-keep interface it.near.sdk.** { *; } |
41 changes: 41 additions & 0 deletions
41
src/androidTest/java/it/near/sdk/Reaction/Content/AudioTest.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,41 @@ | ||
package it.near.sdk.Reaction.Content; | ||
|
||
import android.os.Parcel; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import com.google.common.collect.Maps; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.util.HashMap; | ||
|
||
import it.near.sdk.Reactions.Content.Audio; | ||
|
||
import static junit.framework.Assert.*; | ||
|
||
/** | ||
* Created by cattaneostefano on 02/03/2017. | ||
*/ | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class AudioTest { | ||
|
||
@Test | ||
public void audioIsParcelable() { | ||
Audio audio = new Audio(); | ||
HashMap<String, Object> map = Maps.newHashMap(); | ||
String audioUrl = "http://jsnfijegfuien.mp3"; | ||
map.put("url", audioUrl); | ||
audio.setAudio(map); | ||
audio.setId("audio_id"); | ||
Parcel parcel = Parcel.obtain(); | ||
audio.writeToParcel(parcel, 0); | ||
parcel.setDataPosition(0); | ||
Audio actual = Audio.CREATOR.createFromParcel(parcel); | ||
assertEquals(audio.getAudio(), actual.getAudio()); | ||
assertEquals(audioUrl, actual.getUrl()); | ||
assertEquals(audio.getId(), actual.getId()); | ||
} | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
src/androidTest/java/it/near/sdk/Reaction/Content/ContentTest.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,63 @@ | ||
package it.near.sdk.Reaction.Content; | ||
|
||
import android.os.Parcel; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import com.google.common.collect.Lists; | ||
import com.google.common.collect.Maps; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import it.near.sdk.Reactions.Content.Audio; | ||
import it.near.sdk.Reactions.Content.Content; | ||
import it.near.sdk.Reactions.Content.Image; | ||
import it.near.sdk.Reactions.Content.ImageSet; | ||
import it.near.sdk.Reactions.Content.Upload; | ||
|
||
import static junit.framework.Assert.*; | ||
import static org.hamcrest.Matchers.containsInAnyOrder; | ||
import static org.junit.Assert.assertThat; | ||
|
||
/** | ||
* Created by cattaneostefano on 28/02/2017. | ||
*/ | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class ContentTest { | ||
|
||
@Test | ||
public void contentIsParcelable() { | ||
Content content = new Content(); | ||
content.setContent("content"); | ||
content.setImages_links(Lists.newArrayList(new ImageSet(), new ImageSet())); | ||
content.setVideo_link("video_link"); | ||
content.setId("content_id"); | ||
content.setUpdated_at("updated@whatever"); | ||
Audio audio = new Audio(); | ||
HashMap<String, Object> audioMap = Maps.newHashMap(); | ||
audioMap.put("url", "a.mp3"); | ||
audio.setAudio(audioMap); | ||
content.setAudio(audio); | ||
Upload upload = new Upload(); | ||
HashMap<String, Object> uploadMap = Maps.newHashMap(); | ||
uploadMap.put("url", "a.pdf"); | ||
upload.setUpload(uploadMap); | ||
content.setUpload(upload); | ||
Parcel parcel = Parcel.obtain(); | ||
content.writeToParcel(parcel, 0); | ||
parcel.setDataPosition(0); | ||
Content actual = Content.CREATOR.createFromParcel(parcel); | ||
assertEquals(content.getContent(), actual.getContent()); | ||
assertThat(content.getImages_links(), containsInAnyOrder(actual.getImages_links().toArray())); | ||
assertEquals(content.getVideo_link(), actual.getVideo_link()); | ||
assertEquals(content.getId(), actual.getId()); | ||
assertEquals(content.getUpdated_at(), actual.getUpdated_at()); | ||
assertEquals(content.getAudio().getAudio(), actual.getAudio().getAudio()); | ||
assertEquals(content.getUpload().getUpload(), actual.getUpload().getUpload()); | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/androidTest/java/it/near/sdk/Reaction/Content/UploadTest.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,40 @@ | ||
package it.near.sdk.Reaction.Content; | ||
|
||
import android.os.Parcel; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import com.google.common.collect.Maps; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.util.HashMap; | ||
|
||
import it.near.sdk.Reactions.Content.Upload; | ||
|
||
import static junit.framework.Assert.*; | ||
|
||
/** | ||
* Created by cattaneostefano on 02/03/2017. | ||
*/ | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class UploadTest { | ||
|
||
@Test | ||
public void uploadIsParcelable() { | ||
Upload upload = new Upload(); | ||
upload.setId("upload_id"); | ||
HashMap<String, Object> map = Maps.newHashMap(); | ||
String pdfUrl = "http://jsnfijegfuien.pdf"; | ||
map.put("url", pdfUrl); | ||
upload.setUpload(map); | ||
Parcel parcel = Parcel.obtain(); | ||
upload.writeToParcel(parcel, 0); | ||
parcel.setDataPosition(0); | ||
Upload actual = Upload.CREATOR.createFromParcel(parcel); | ||
assertEquals(upload.getId(), actual.getId()); | ||
assertEquals(upload.getUpload(), actual.getUpload()); | ||
assertEquals(pdfUrl, actual.getUrl()); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/androidTest/java/it/near/sdk/Reaction/Coupon/CouponTest.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,55 @@ | ||
package it.near.sdk.Reaction.Coupon; | ||
|
||
import android.os.Parcel; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import com.google.common.collect.Lists; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import it.near.sdk.Reactions.Content.Content; | ||
import it.near.sdk.Reactions.Content.ImageSet; | ||
import it.near.sdk.Reactions.Coupon.Claim; | ||
import it.near.sdk.Reactions.Coupon.Coupon; | ||
|
||
import static junit.framework.Assert.*; | ||
import static org.hamcrest.Matchers.containsInAnyOrder; | ||
import static org.junit.Assert.assertThat; | ||
|
||
/** | ||
* Created by cattaneostefano on 28/02/2017. | ||
*/ | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class CouponTest { | ||
|
||
@Test | ||
public void couponIsParcelable() { | ||
Coupon coupon = new Coupon(); | ||
coupon.setId("coupon_id"); | ||
coupon.setName("coupon_name"); | ||
coupon.setDescription("coupon_description"); | ||
coupon.setValue("coupon_value"); | ||
coupon.setExpires_at("expiring_soon"); | ||
coupon.setIcon_id("coupon_icon_id"); | ||
coupon.setClaims(Lists.newArrayList(new Claim(), new Claim())); | ||
coupon.setIconSet(new ImageSet()); | ||
|
||
Parcel parcel = Parcel.obtain(); | ||
coupon.writeToParcel(parcel, 0); | ||
parcel.setDataPosition(0); | ||
Coupon actual = Coupon.CREATOR.createFromParcel(parcel); | ||
|
||
assertEquals(coupon.getId(), actual.getId()); | ||
assertEquals(coupon.getName(), actual.getName()); | ||
assertEquals(coupon.getDescription(), actual.getDescription()); | ||
assertEquals(coupon.getValue(), actual.getValue()); | ||
assertEquals(coupon.getExpires_at(), actual.getExpires_at()); | ||
assertEquals(coupon.getIcon_id(), actual.getIcon_id()); | ||
assertThat(coupon.getClaims(), containsInAnyOrder(actual.getClaims().toArray())); | ||
assertEquals(coupon.getIconSet(), actual.getIconSet()); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.