From: David ‘Bombe’ Roden Date: Thu, 14 Sep 2017 17:28:45 +0000 (+0200) Subject: Add test for error return object X-Git-Tag: 0.9.7^2~58 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=218bb044316c3486ea566a33d3d41254308b80d3;p=Sone.git Add test for error return object --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObjectTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObjectTest.kt new file mode 100644 index 0000000..bf61e2e --- /dev/null +++ b/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonErrorReturnObjectTest.kt @@ -0,0 +1,24 @@ +package net.pterodactylus.sone.web.ajax + +import org.hamcrest.MatcherAssert.assertThat +import org.hamcrest.Matchers.equalTo +import org.junit.Test + +/** + * Unit test for [JsonErrorReturnObject]. + */ +class JsonErrorReturnObjectTest { + + private val returnObject = JsonErrorReturnObject("nope") + + @Test + fun `error return object is not successful`() { + assertThat(returnObject.isSuccess, equalTo(false)) + } + + @Test + fun `error return object exposes error`() { + assertThat(returnObject.error, equalTo("nope")) + } + +}