From b1957ea1e827ace9b2f0b67dc105395ce05d208e Mon Sep 17 00:00:00 2001 From: Philippe Simons Date: Thu, 12 Sep 2019 09:58:57 +0200 Subject: [PATCH] add tests --- build.gradle | 9 +++++++++ .../net/volcanomobile/weservsdk/WeservTests.kt | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/test/kotlin/net/volcanomobile/weservsdk/WeservTests.kt diff --git a/build.gradle b/build.gradle index a5d29dd..3a587b5 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,8 @@ repositories { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + + testImplementation "org.junit.jupiter:junit-jupiter:5.5.2" } compileKotlin { @@ -21,6 +23,13 @@ compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } +test { + useJUnitPlatform() + testLogging { + events "passed", "skipped", "failed" + } +} + Properties properties = new Properties() File file = rootProject.file('local.properties') if (file.exists()) { diff --git a/src/test/kotlin/net/volcanomobile/weservsdk/WeservTests.kt b/src/test/kotlin/net/volcanomobile/weservsdk/WeservTests.kt new file mode 100644 index 0000000..4d92ceb --- /dev/null +++ b/src/test/kotlin/net/volcanomobile/weservsdk/WeservTests.kt @@ -0,0 +1,14 @@ +package net.volcanomobile.weservsdk + +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.Test + +class WeservTests { + + @Test + fun `no Url throws exception`() { + Assertions.assertThrows(IllegalArgumentException::class.java) { + weserv { } + } + } +} \ No newline at end of file