StringToDMYConverterTest.java 785 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2025. Andrew Grant Carrick Software. All rights reserved
  3. *
  4. */
  5. package scot.carricksoftware.grantswriter.converters;
  6. import org.junit.jupiter.api.BeforeEach;
  7. import org.junit.jupiter.api.Test;
  8. import scot.carricksoftware.grantswriter.data.DMY;
  9. import static org.junit.jupiter.api.Assertions.assertEquals;
  10. public class StringToDMYConverterTest {
  11. private StringToDMYConverter converter;
  12. @BeforeEach
  13. public void setUp() {
  14. converter = new StringToDMYConverterImpl();
  15. }
  16. @Test
  17. void testConvert() {
  18. String testString = "25/01/1953";
  19. DMY dmy = converter.convert(testString);
  20. assertEquals("25", dmy.getDay());
  21. assertEquals("01", dmy.getMonth());
  22. assertEquals("1953", dmy.getYear());
  23. }
  24. }