Skip to content

Commit

Permalink
Modularise message manager tests
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Oct 30, 2024
1 parent a3efa22 commit 4b58bb7
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@ package foundation.esoteric.minecraft.plugins.library.messages
import be.seeseemelk.mockbukkit.MockBukkit
import foundation.esoteric.minecraft.plugins.library.TestPlugin
import java.io.File
import kotlin.test.AfterTest
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertTrue

class MessageManagerTest {
@Test fun savesMessagesResource() {

private var plugin: TestPlugin? = null
private var messageManager: MessageManager? = null

@BeforeTest fun mockMessageManager() {
MockBukkit.mock()
val plugin = MockBukkit.load(TestPlugin::class.java)
plugin = MockBukkit.load(TestPlugin::class.java)

val messageManager = MessageManager(plugin)
messageManager = MessageManager(plugin!!)
}

val messagesFolder = File(plugin.dataFolder, "messages")
@Test fun savesMessagesResource() {
val messagesFolder = File(plugin!!.dataFolder, "messages")
assertTrue(messagesFolder.exists())
}

@AfterTest fun unmockMessageManager() {
MockBukkit.unmock()
}
}

0 comments on commit 4b58bb7

Please sign in to comment.