Support for Instrumentation Testing

This commit is contained in:
Bruno Martins 2017-11-14 15:46:50 +00:00
parent 41580e5519
commit cb4c7e2e2d
3 changed files with 55 additions and 0 deletions

View File

@ -43,6 +43,16 @@ dependencies {
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
androidTestCompile 'com.android.support:support-annotations:25.4.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
// Optional -- Hamcrest library
//androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
//androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
// Optional -- UI testing with UI Automator
//androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
}
dependencyVerification {

View File

@ -0,0 +1,30 @@
package com.m2049r.xmrwallet.util;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import com.m2049r.xmrwallet.model.Wallet;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Created by bruno on 14/11/2017.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
public class HelperTest {
/**
*
*/
@Test
public void checkValidAddressExample_1() {
// random generated address by https://xmr.llcoins.net/addresstests.html
String publicAddr = "4GKacjHuTGeReA7PvxPhehDswu3RwpnAqeJV2kdU3MLMNUr4Lt9pxcRiWU2E6BoDReADhCPtHfvNFh1YVNLFoZE5YtaSMc8MSbGGudRftK";
Assert.assertTrue(Wallet.isAddressValid(publicAddr, false));
}
}

View File

@ -0,0 +1,15 @@
package com.m2049r.xmrwallet.util.suite;
/**
* Created by bruno on 14/11/2017.
*/
import com.m2049r.xmrwallet.util.HelperTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
// Runs all unit tests.
@RunWith(Suite.class)
@Suite.SuiteClasses({HelperTest.class})
public class UnitTestSuite {}