configure unit testing for project

This commit is contained in:
mykola2312 2024-04-08 08:36:00 +03:00
parent 532d3ed89b
commit 41ebc47800
3 changed files with 40 additions and 1 deletions

22
pom.xml
View file

@ -4,7 +4,7 @@
<groupId>com.mykola2312</groupId>
<artifactId>mptv</artifactId>
<version>0.1.0</version>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -12,4 +12,24 @@
<maven.compiler.target>22</maven.compiler.target>
<exec.mainClass>com.mykola2312.mptv.Main</exec.mainClass>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>mptv</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,17 @@
package com.mykola2312.mptv;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestI18n {
@Test()
public void testKeys() {
assertEquals("Value1", I18n.get("Key1"));
assertEquals("Value2", I18n.get("Key2"));
}
@Test()
public void testNotFound() {
assertEquals("KeyNotFound", I18n.get("KeyNotFound"));
}
}

View file

@ -0,0 +1,2 @@
Key1=Value1
Key2=Value2