import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; import org.junit.Test; import java.security.InvalidParameterException; public class TestLabel { @SuppressWarnings("unused") @Test public void testConstructor() { Label lb = new Label("abcdef"); } @SuppressWarnings("unused") @Test public void testConstructorFouteInvoer_Null() { assertThrows(InvalidParameterException.class, () -> { Label lb = new Label(null); }); } @SuppressWarnings("unused") @Test public void testConstructorFouteInvoer_LegeString() { assertThrows(InvalidParameterException.class, () -> { Label lb = new Label(""); }); } @SuppressWarnings("unused") @Test public void testConstructorFouteInvoer_TeKleineString() { assertThrows(InvalidParameterException.class, () -> { Label lb = new Label("abcde"); }); } @SuppressWarnings("unused") @Test public void testConstructorFouteInvoer_TeGroteString() { assertThrows(InvalidParameterException.class, () -> { Label lb = new Label("abcdefg"); }); } @SuppressWarnings("unused") @Test public void testConstructorFouteInvoer_Hoofdletter() { assertThrows(InvalidParameterException.class, () -> { Label lb = new Label("abcDef"); }); } @SuppressWarnings("unused") @Test public void testConstructorFouteInvoer_Anderkarakter() { assertThrows(InvalidParameterException.class, () -> { Label lb = new Label("a+cdef"); }); assertThrows(InvalidParameterException.class, () -> { Label lb = new Label("abcd3f"); }); } @Test public void testHashCode() { assertEquals(0, (new Label("aaaaaa")).hashCode()); assertEquals(1, (new Label("aaaaab")).hashCode()); assertEquals(494265, (new Label("abcdef")).hashCode()); assertEquals(61288890, (new Label("fedcba")).hashCode()); assertEquals(308915774, (new Label("zzzzzy")).hashCode()); assertEquals(308915775, (new Label("zzzzzz")).hashCode()); } }