Skip to content

Commit

Permalink
Add test driver code.
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyTangAndroid committed Oct 4, 2019
1 parent c728913 commit 31b3146
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ ext {
timberVersion = '4.7.1'
injectVersion = '1'

//test
truthVersion = '1.0'

}
3 changes: 3 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ dependencies {
// implementation project(':wood-no-op')
implementation "com.jakewharton.timber:timber:$timberVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersioon"

testImplementation 'junit:junit:4.12'
testImplementation "com.google.truth:truth:$truthVersion"
}
14 changes: 14 additions & 0 deletions sample/src/test/java/com/tonytangandroid/wood/sample/AppTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.tonytangandroid.wood.sample;

import com.google.common.truth.Truth;

import org.junit.Test;

public class AppTest {

@Test
public void onCreate() {

Truth.assertThat(1 + 1).isEqualTo(2);
}
}
4 changes: 4 additions & 0 deletions wood/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ dependencies {
annotationProcessor "androidx.room:room-compiler:$roomVersion"
implementation "androidx.paging:paging-runtime:$pagingVersion"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"


testImplementation 'junit:junit:4.12'
testImplementation "com.google.truth:truth:$truthVersion"
}

// Place it at the end of the file
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.tonytangandroid.wood;

import com.google.common.truth.Truth;

import org.junit.Test;

public class ClearTransactionsServiceTest {

@Test
public void onHandleIntent() {

Truth.assertThat(1 + 1).isEqualTo(2);

}
}

0 comments on commit 31b3146

Please sign in to comment.