Skip to content
Snippets Groups Projects
Commit f2de79f2 authored by NeggutsMc's avatar NeggutsMc
Browse files

panel admin

parent b6ca527a
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PWA">
<option name="enabled" value="true" />
<option name="wasEnabledAtLeastOnce" value="true" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="openjdk-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
......
......@@ -16,5 +16,31 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="JUnit5.8.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class PanelTest {
@Test
void validateCompetitionData_WithValidData_ShouldReturnTrue() {
Panel panel = new Panel(null);
assertTrue(panel.validateCompetitionData("Paris", "2024-01-01 10:00", "100"));
}
@Test
void validateCompetitionData_WithInvalidData_ShouldReturnFalse() {
Panel panel = new Panel(null);
assertFalse(panel.validateCompetitionData("", "2024-01-01 10:00", "100"));
assertFalse(panel.validateCompetitionData("Paris", "", "100"));
assertFalse(panel.validateCompetitionData("Paris", "2024-01-01 10:00", "abc")); // non-numérique
}
@Test
void validateDateTime_WithValidDateTime_ShouldReturnTrue() {
Panel panel = new Panel(null);
assertTrue(panel.validateDateTime("2024-01-01 12:00:00"));
}
@Test
void validateDateTime_WithInvalidDateTime_ShouldReturnFalse() {
Panel panel = new Panel(null);
assertFalse(panel.validateDateTime("2024-01-01 25:00:00")); // Heure invalide
assertFalse(panel.validateDateTime("2024-13-01 12:00:00")); // Mois invalide
assertFalse(panel.validateDateTime("2024-02-30 12:00:00")); // Jour invalide
}
@Test
void convertToInt_WithValidNumber_ShouldReturnInt() {
Panel panel = new Panel(null);
assertEquals(100, panel.convertToInt("100"));
}
@Test
void convertToInt_WithInvalidNumber_ShouldThrowException() {
Panel panel = new Panel(null);
assertThrows(NumberFormatException.class, () -> {
panel.convertToInt("abc");
});
}
}
panel_admin_sae/src/src/logo.png

31 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment