MCPcopy Create free account
hub / github.com/Neop/mudmap2 / testSetPathColor

Method testSetPathColor

src/test/java/mudmap2/backend/WorldTest.java:463–494  ·  view source on GitHub ↗

Test of setPathColor method, of class World.

()

Source from the content-addressed store, hash-verified

461 * Test of setPathColor method, of class World.
462 */
463 @Test
464 public void testSetPathColor() {
465 System.out.println("setPathColor");
466
467 String dir1 = "foo";
468 Color color1 = Color.GRAY;
469 World instance = new World("MyWorld");
470 instance.setPathColor(dir1, color1);
471 Color result1 = instance.getPathColor(dir1);
472 assertEquals(color1, result1);
473
474 String dir2 = "n";
475 Color color2 = Color.RED;
476 instance.setPathColor(dir2, color2);
477 Color result2 = instance.getPathColor(dir2);
478 assertEquals(color2, result2);
479
480 // test null
481 try {
482 instance.setPathColor(null, Color.BLUE);
483 fail();
484 } catch(Exception ex){
485 // expected
486 }
487
488 try {
489 instance.setPathColor("n", null);
490 fail();
491 } catch(Exception ex){
492 // expected
493 }
494 }
495
496 /**
497 * Test of getPathColors method, of class World.

Callers

nothing calls this directly

Calls 2

setPathColorMethod · 0.95
getPathColorMethod · 0.95

Tested by

no test coverage detected