BirthCertificateCommandInformantTest.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) Andrew Grant of Carrick Software 24/03/2025, 17:31. All rights reserved.
  3. *
  4. */
  5. package scot.carricksoftware.grants.commands.certificates;
  6. import org.junit.jupiter.api.BeforeEach;
  7. import org.junit.jupiter.api.Test;
  8. import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
  9. import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
  10. import scot.carricksoftware.grants.domains.people.Person;
  11. import static org.junit.jupiter.api.Assertions.assertEquals;
  12. import static org.junit.jupiter.api.Assertions.assertNull;
  13. import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
  14. import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
  15. class BirthCertificateCommandInformantTest {
  16. private BirthCertificateCommand command;
  17. @BeforeEach
  18. void setUp() {
  19. command = new BirthCertificateCommandImpl();
  20. }
  21. @Test
  22. public void getInformantTest() {
  23. assertNull(command.getInformant());
  24. }
  25. @Test
  26. public void setInformantTest() {
  27. Person informant = GetRandomPerson();
  28. command.setInformant(informant);
  29. assertEquals(informant, command.getInformant());
  30. }
  31. @Test
  32. public void getUntrackedInformantTest() {
  33. assertNull(command.getUntrackedInformant());
  34. }
  35. @Test
  36. public void setUntrackedInformantTest() {
  37. String untrackedInformant = GetRandomString();
  38. command.setUntrackedInformant(untrackedInformant);
  39. assertEquals(untrackedInformant, command.getUntrackedInformant());
  40. }
  41. @Test
  42. public void getInformantQualificationTest() {
  43. assertNull(command.getInformantQualification());
  44. }
  45. @Test
  46. public void setInformantQualificationTest() {
  47. String informantQualification = GetRandomString();
  48. command.setInformantQualification(informantQualification);
  49. assertEquals(informantQualification, command.getInformantQualification());
  50. }
  51. }