Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyrkx committed Mar 18, 2024
1 parent 269da80 commit c991221
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/tutorpro/model/person/PersonTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tutorpro.model.person;

import static org.junit.jupiter.api.Assertions.fail;
import static tutorpro.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static tutorpro.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static tutorpro.logic.commands.CommandTestUtil.VALID_NAME_BOB;
Expand All @@ -12,6 +13,7 @@
import tutorpro.model.tag.Tag;
import tutorpro.testutil.Assert;
import tutorpro.testutil.PersonBuilder;
import tutorpro.testutil.StudentBuilder;
import tutorpro.testutil.TypicalPersons;

public class PersonTest {
Expand Down Expand Up @@ -104,4 +106,16 @@ public void addTags() {
person.addTags(tag);
Assertions.assertTrue(person.getTags().contains(tag));
}

@Test
public void getCard() {
try {
new StudentBuilder().build().getCard(1);
fail();
} catch (ExceptionInInitializerError e) {
return;
} catch (NoClassDefFoundError e) {
return;
}
}
}
13 changes: 13 additions & 0 deletions src/test/java/tutorpro/model/person/student/StudentTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tutorpro.model.person.student;

import static org.junit.jupiter.api.Assertions.fail;
import static tutorpro.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static tutorpro.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static tutorpro.logic.commands.CommandTestUtil.VALID_LEVEL_UNI;
Expand Down Expand Up @@ -75,4 +76,16 @@ public void equals() {
editedAlice = new StudentBuilder(TypicalStudents.ALICE).withLevel(VALID_LEVEL_UNI).build();
Assertions.assertFalse(TypicalStudents.ALICE.equals(editedAlice));
}

@Test
public void getCard() {
try {
new StudentBuilder().build().getCard(1);
fail();
} catch (ExceptionInInitializerError e) {
return;
} catch (NoClassDefFoundError e) {
return;
}
}
}

0 comments on commit c991221

Please sign in to comment.