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

Method testGetPlaces

src/test/java/mudmap2/backend/LayerTest.java:788–811  ·  view source on GitHub ↗

Test of getPlaces method, of class Layer.

()

Source from the content-addressed store, hash-verified

786 * Test of getPlaces method, of class Layer.
787 */
788 @Test
789 public void testGetPlaces() {
790 System.out.println("getPlaces");
791
792 Layer instance = new Layer(world);
793
794 HashSet<Place> result = instance.getPlaces();
795 assertNotNull(result);
796 assertTrue(result.isEmpty());
797
798 Place el1 = new Place("Place1", 0, 0, instance);
799 Place el2 = new Place("Place2", -1, 2, instance);
800 try {
801 instance.put(el1);
802 instance.put(el2);
803
804 result = instance.getPlaces();
805 assertEquals(2, result.size());
806 assertTrue(result.contains(el1));
807 assertTrue(result.contains(el2));
808 } catch (Layer.PlaceNotInsertedException ex) {
809 fail(ex.getMessage());
810 }
811 }
812
813 /**
814 * Test of toString method, of class Layer.

Callers

nothing calls this directly

Calls 4

getPlacesMethod · 0.95
putMethod · 0.95
isEmptyMethod · 0.65
containsMethod · 0.65

Tested by

no test coverage detected