From 3116fe3c215995c9afc94357544e7f8c7507549b Mon Sep 17 00:00:00 2001 From: Eric Stokes Date: Sat, 19 Nov 2016 16:18:12 -0500 Subject: [PATCH] Added additional properties to the test checks for world properties (cherry picked from commit f3a420d85cc0a96cfc58c3ea5cfaca8ab153eb9b) --- .../MultiverseCore/TestWorldProperties.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java b/src/test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java index bf53b71d..b74957c1 100644 --- a/src/test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java +++ b/src/test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java @@ -19,6 +19,7 @@ import org.bukkit.Difficulty; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.World; +import org.bukkit.WorldType; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; @@ -104,6 +105,12 @@ public class TestWorldProperties { verify(mockCommandSender).sendMessage("Starting import of world 'world'..."); verify(mockCommandSender).sendMessage(ChatColor.GREEN + "Complete!"); + assertEquals(core.getServer().getWorlds().size(), 1); + assertEquals(core.getServer().getWorlds().get(0).getName(), "world"); + assertEquals(core.getServer().getWorlds().get(0).getEnvironment(), World.Environment.NORMAL); + assertEquals(core.getServer().getWorlds().get(0).getWorldType(), WorldType.NORMAL); + + // Import a second world String[] netherArgs = new String[] { "import", "world_nether", "nether" }; core.onCommand(mockCommandSender, mockCommand, "", netherArgs); @@ -111,6 +118,12 @@ public class TestWorldProperties { verify(mockCommandSender, VerificationModeFactory.times(2)).sendMessage( ChatColor.GREEN + "Complete!"); + assertEquals(core.getServer().getWorlds().size(), 2); + assertEquals(core.getServer().getWorlds().get(0).getName(), "world"); + assertEquals(core.getServer().getWorlds().get(1).getName(), "world_nether"); + assertEquals(core.getServer().getWorlds().get(1).getEnvironment(), World.Environment.NETHER); + assertEquals(core.getServer().getWorlds().get(1).getWorldType(), WorldType.NORMAL); + // //////////////////////////////////////////////// // let's set some world-properties // we can test the API with this, too :D