From: David ‘Bombe’ Roden Date: Tue, 19 Mar 2019 17:07:22 +0000 (+0100) Subject: 🎨 Replace profile test with Kotlin version X-Git-Tag: v79^2~70 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a1def3f61dd35f6bf9123ddfba2991debb317cee;p=Sone.git 🎨 Replace profile test with Kotlin version --- diff --git a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java b/src/test/java/net/pterodactylus/sone/data/ProfileTest.java deleted file mode 100644 index c0cb9de..0000000 --- a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.pterodactylus.sone.data; - -import net.pterodactylus.sone.data.Profile.Field; - -import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; -import org.junit.Test; -import org.mockito.Mockito; - -/** - * Unit test for {@link Profile}. - */ -public class ProfileTest { - - private final Sone sone = Mockito.mock(Sone.class); - private final Profile profile = new Profile(sone); - - @Test - public void newFieldsAreInitializedWithAnEmptyString() { - Field newField = profile.addField("testField"); - MatcherAssert.assertThat(newField.getValue(), Matchers.is("")); - } - -} diff --git a/src/test/kotlin/net/pterodactylus/sone/data/ProfileTest.kt b/src/test/kotlin/net/pterodactylus/sone/data/ProfileTest.kt new file mode 100644 index 0000000..5c82574 --- /dev/null +++ b/src/test/kotlin/net/pterodactylus/sone/data/ProfileTest.kt @@ -0,0 +1,22 @@ +package net.pterodactylus.sone.data + +import net.pterodactylus.sone.test.* +import org.hamcrest.MatcherAssert.* +import org.hamcrest.Matchers.* +import org.junit.* + +/** + * Unit test for [Profile]. + */ +class ProfileTest { + + private val sone = mock() + private val profile = Profile(sone) + + @Test + fun `new fields are initialized with an empty string`() { + val newField = profile.addField("testField") + assertThat(newField.value, equalTo("")) + } + +}