Added additional properties to the test checks for world properties

(cherry picked from commit f3a420d85c)
This commit is contained in:
Eric Stokes 2016-11-19 16:18:12 -05:00 committed by Jeremy Wood
parent 92b6a9a6fc
commit 3116fe3c21

View File

@ -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