From: David ‘Bombe’ Roden Date: Fri, 29 Nov 2019 17:07:41 +0000 (+0100) Subject: ✅ Add test for saving insertion delay X-Git-Tag: v81^2~14 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c42437041e7d4ff9e9146794136e0c294208f5da;p=Sone.git ✅ Add test for saving insertion delay --- diff --git a/src/test/kotlin/net/pterodactylus/sone/core/PreferencesTest.kt b/src/test/kotlin/net/pterodactylus/sone/core/PreferencesTest.kt index 6da6658..245ff03 100644 --- a/src/test/kotlin/net/pterodactylus/sone/core/PreferencesTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/core/PreferencesTest.kt @@ -6,6 +6,7 @@ import net.pterodactylus.sone.fcp.FcpInterface.* import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired.* import net.pterodactylus.sone.fcp.event.* import net.pterodactylus.sone.test.* +import net.pterodactylus.util.config.* import org.hamcrest.MatcherAssert.* import org.hamcrest.Matchers.* import org.junit.* @@ -64,6 +65,13 @@ class PreferencesTest { } @Test + fun `preferences saves null for default insertion delay setting`() { + val configuration = Configuration(MapConfigurationBackend()) + preferences.saveTo(configuration) + assertThat(configuration.getIntValue("Option/InsertionDelay").getValue(null), nullValue()) + } + + @Test fun `preferences retain posts per page`() { preferences.newPostsPerPage = 15 assertThat(preferences.postsPerPage, equalTo(15))