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

Method testCompareTo

src/test/java/mudmap2/backend/PlaceTest.java:825–845  ·  view source on GitHub ↗

Test of compareTo method, of class Place.

()

Source from the content-addressed store, hash-verified

823 * Test of compareTo method, of class Place.
824 */
825 @Test
826 public void testCompareTo() {
827 System.out.println("compareTo");
828
829 Place instance = new Place("MyPlace", 1, 1, layer);
830 Place p1 = new Place("MyPlace", 0, 0, layer);
831 Place p2 = new Place("Another Place", -1, 2, layer);
832
833 try {
834 instance.compareTo(null);
835 fail();
836 } catch (Exception e) {}
837
838 int expResult = instance.getName().compareTo(p1.getName());
839 int result = instance.compareTo(p1);
840 assertEquals(expResult, result);
841
842 expResult = instance.getName().compareTo(p2.getName());
843 result = instance.compareTo(p2);
844 assertEquals(expResult, result);
845 }
846
847 /**
848 * Test of removeConnections method, of class Place.

Callers

nothing calls this directly

Calls 2

compareToMethod · 0.95
getNameMethod · 0.95

Tested by

no test coverage detected