diff --git a/banddetection/build.gradle b/banddetection/build.gradle index 5633b1e..bd7de7c 100644 --- a/banddetection/build.gradle +++ b/banddetection/build.gradle @@ -76,6 +76,7 @@ install { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' + testCompile 'org.hamcrest:hamcrest-library:1.3' //noinspection GradleDependency compile 'com.android.support:appcompat-v7:23.2.1' androidTestCompile 'junit:junit:4.12' diff --git a/banddetection/src/test/java/nu/shel/banddetection/ExampleUnitTest.java b/banddetection/src/test/java/nu/shel/banddetection/ExampleUnitTest.java deleted file mode 100644 index 1d9359c..0000000 --- a/banddetection/src/test/java/nu/shel/banddetection/ExampleUnitTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package nu.shel.banddetection; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * To work on unit tests, switch the Test Artifact in the Build Variants view. - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file diff --git a/banddetection/src/androidTest/java/nu/shel/banddetection/LTEBandTest.java b/banddetection/src/test/java/nu/shel/banddetection/LTEBandTest.java similarity index 83% rename from banddetection/src/androidTest/java/nu/shel/banddetection/LTEBandTest.java rename to banddetection/src/test/java/nu/shel/banddetection/LTEBandTest.java index b97a26a..8240b59 100644 --- a/banddetection/src/androidTest/java/nu/shel/banddetection/LTEBandTest.java +++ b/banddetection/src/test/java/nu/shel/banddetection/LTEBandTest.java @@ -1,5 +1,7 @@ package nu.shel.banddetection; +import android.test.suitebuilder.annotation.SmallTest; + import junit.framework.TestCase; import org.junit.Test; @@ -8,7 +10,7 @@ import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; -public class LTEBandTest extends TestCase{ +public class LTEBandTest { @Test public void GetBandFromEarfcn_returnsBand41() { @@ -17,7 +19,7 @@ public void GetBandFromEarfcn_returnsBand41() { @Test public void GetBandFromEarfcn_InvalidBandLow_returnsBand0() { - assertThat(GetBandFromEarfcn(-1).band, is(41)); + assertThat(GetBandFromEarfcn(-1).band, is(0)); } @Test