✅ Add method to set debug flag
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / core / CoreTest.kt
index d8d4f0b..f595cc0 100644 (file)
@@ -137,7 +137,7 @@ class CoreTest {
        }
 
        @Test
-       fun `core starts without debug flags`() {
+       fun `core starts with debug set to false`() {
                val configuration = mock<Configuration>()
                val freenetInterface = mock<FreenetInterface>()
                val identityManager = mock<IdentityManager>()
@@ -148,7 +148,23 @@ class CoreTest {
                val eventBus = mock<EventBus>()
                val database = mock<Database>()
                val core = Core(configuration, freenetInterface, identityManager, soneDownloader, imageInserter, updateChecker, webOfTrustUpdater, eventBus, database)
-               assertThat(core.debugInformation.showVersionInformation, equalTo(false))
+               assertThat(core.debug, equalTo(false))
+       }
+
+       @Test
+       fun `debug flag can be set`() {
+               val configuration = mock<Configuration>()
+               val freenetInterface = mock<FreenetInterface>()
+               val identityManager = mock<IdentityManager>()
+               val soneDownloader = mock<SoneDownloader>()
+               val imageInserter = mock<ImageInserter>()
+               val updateChecker = mock<UpdateChecker>()
+               val webOfTrustUpdater = mock<WebOfTrustUpdater>()
+               val eventBus = mock<EventBus>()
+               val database = mock<Database>()
+               val core = Core(configuration, freenetInterface, identityManager, soneDownloader, imageInserter, updateChecker, webOfTrustUpdater, eventBus, database)
+               core.setDebug()
+               assertThat(core.debug, equalTo(true))
        }
 
 }