refactor: move test files

This commit is contained in:
2026-04-16 18:33:38 +03:30
parent ce2268ac06
commit 70fda9d1e6
7 changed files with 14 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
package BonusTests;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
public class TestDates {
static BonusExercises ex;
@BeforeAll
static void setUp() {
ex = new BonusExercises();
}
@Test
void testDates0() {
String input = "Today is 12/09/2023.";
String expected = "12/09/2023";
assertEquals(expected, ex.findDate(input));
}
@Test
void testDates1() {
String input = "Meeting: 2024-07-15 at noon.";
String expected = "2024-07-15";
assertEquals(expected, ex.findDate(input));
}
@Test
void testDates2() {
String input = "No date here.";
assertNull(ex.findDate(input));
}
@Test
void testDates3() {
String input = "Release date will be 2025/01/01 (hopefully) at midnight";
String expected = "2025/01/01";
assertEquals(expected, ex.findDate(input));
}
@Test
void testDates4() {
String input = "Meet me at 45/12/2023.";
assertNull(ex.findDate(input));
}
}