Created
November 1, 2015 12:09
-
-
Save cnevinc/06f720f31823632fbf5d to your computer and use it in GitHub Desktop.
Config test using Kotlin
This file contains hidden or 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
package com.biideal.biibonus.ui | |
import com.biideal.biibonus.util.Config | |
import junit.framework.Assert | |
import org.junit.Test | |
/** | |
* Test the util implementation | |
*/ | |
public class ConfigTest { | |
@Test fun testDeepLink() { | |
var url = "biibonus://coupon/12?store_id=2&sotre_id=3" | |
var result = Config.parseDeepLink(url) | |
Assert.assertEquals("coupon", result["feature"]) | |
Assert.assertEquals("2", result["store_id"]) | |
Assert.assertEquals("/12", result["path"]) | |
url = "Biibonus2://coupon/12?store_id=2" | |
result = Config.parseDeepLink(url) | |
Assert.assertEquals("coupon", result["feature"]) | |
Assert.assertEquals("2", result["store_id"]) | |
Assert.assertEquals("/12", result["path"]) | |
url = "Biibonus2://coupon/12?store_id=2&coupon_id=3" | |
result = Config.parseDeepLink(url) | |
Assert.assertEquals("coupon", result["feature"]) | |
Assert.assertEquals("2", result["store_id"]) | |
Assert.assertEquals("3", result["coupon_id"]) | |
Assert.assertEquals("/12", result["path"]) | |
url = "biibonus://coupon/id/12?store_id=2&sotre_id=3&store_id=2" | |
result = Config.parseDeepLink(url) | |
Assert.assertEquals("coupon", result["feature"]) | |
Assert.assertEquals("2", result["store_id"]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment