Skip to content

Commit 92eac57

Browse files
committed
Revert "Remove Tests"
This reverts commit 630b7c9
1 parent fe8f557 commit 92eac57

6 files changed

Lines changed: 110 additions & 4 deletions

File tree

.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ android {
3535
targetSdkVersion 30
3636
versionCode 2
3737
versionName "0.1.1-beta"
38+
39+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3840
}
3941

4042
buildTypes {
@@ -57,7 +59,10 @@ dependencies {
5759
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
5860
implementation 'androidx.core:core-ktx:1.3.2'
5961
implementation 'androidx.appcompat:appcompat:1.2.0'
60-
implementation 'com.google.android.material:material:1.2.1'
61-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
62+
implementation 'com.google.android.material:material:1.1.0'
63+
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
64+
testImplementation 'junit:junit:4.+'
65+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
66+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
6267
implementation "com.android.support:support-compat:28.0.0"
6368
}

app/release/output-metadata.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": 2,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "com.ktprograms.watertracker",
8+
"variantName": "processReleaseResources",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"versionCode": 2,
14+
"versionName": "0.1.1-beta",
15+
"outputFile": "app-release.apk"
16+
}
17+
]
18+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* GNU General Public License v3.0
3+
*
4+
* Copyright (c) 2020 Toh Jeen Gie Keith
5+
*
6+
*
7+
* This file is part of WaterTracker.
8+
*
9+
* WaterTracker is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* WaterTracker is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with WaterTracker. If not, see <https://www.gnu.org/licenses/>.
21+
*/
22+
23+
package com.ktprograms.watertracker
24+
25+
import androidx.test.platform.app.InstrumentationRegistry
26+
import androidx.test.ext.junit.runners.AndroidJUnit4
27+
28+
import org.junit.Test
29+
import org.junit.runner.RunWith
30+
31+
import org.junit.Assert.*
32+
33+
/**
34+
* Instrumented test, which will execute on an Android device.
35+
*
36+
* See [testing documentation](http://d.android.com/tools/testing).
37+
*/
38+
@RunWith(AndroidJUnit4::class)
39+
class ExampleInstrumentedTest {
40+
@Test
41+
fun useAppContext() {
42+
// Context of the app under test.
43+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
44+
assertEquals("com.ktprograms.watertracker", appContext.packageName)
45+
}
46+
}

app/src/main/java/com/ktprograms/watertracker/AlarmReceiver.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import android.app.PendingIntent
2626
import android.content.BroadcastReceiver
2727
import android.content.Context
2828
import android.content.Intent
29-
import android.net.Uri
3029
import androidx.core.app.NotificationCompat
3130
import androidx.core.app.NotificationManagerCompat
3231

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* GNU General Public License v3.0
3+
*
4+
* Copyright (c) 2020 Toh Jeen Gie Keith
5+
*
6+
*
7+
* This file is part of WaterTracker.
8+
*
9+
* WaterTracker is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* WaterTracker is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with WaterTracker. If not, see <https://www.gnu.org/licenses/>.
21+
*/
22+
23+
package com.ktprograms.watertracker
24+
25+
import org.junit.Test
26+
27+
import org.junit.Assert.*
28+
29+
/**
30+
* Example local unit test, which will execute on the development machine (host).
31+
*
32+
* See [testing documentation](http://d.android.com/tools/testing).
33+
*/
34+
class ExampleUnitTest {
35+
@Test
36+
fun addition_isCorrect() {
37+
assertEquals(4, 2 + 2)
38+
}
39+
}

0 commit comments

Comments
 (0)