NoIssue: Cleanup

This commit is contained in:
Minimons
2025-11-19 12:19:12 +01:00
parent 913e14cc22
commit 9ca9c973ca
3 changed files with 3 additions and 83 deletions

View File

@@ -29,8 +29,7 @@ repositories {
dependencies {
// The test classes are compiled with these:
implementation("com.r35157.libs:valuetypes-basic-api:0.0.0")
implementation("com.r35157.libs:valuetypes-basic-impl-ref:0.0.0")
implementation("com.r35157.libs:valuetypes-basic-api:0.1-dev")
implementation("org.jetbrains:annotations:26.0.1")
// The JUnit platform will not be included in the JAR file but are needed for running the tests:

View File

@@ -1,52 +1,14 @@
package com.r35157.libs.valuetypes.basic.tests;
import com.r35157.libs.valuetypes.basic.SomeInterface;
import com.r35157.libs.valuetypes.basic.impl.ref.SomeImpl;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
@DisplayName("Happy Initialization Tests")
public class HappyInitializationTests {
@BeforeAll
public static void beforeAll() {
System.out.println("==== Before All");
}
@BeforeEach
public void beforeEach() {
System.out.println("---- Before Each");
}
@DisplayName("Just a basic test")
@Test
void someBasicTest() {
// Arrange
String a = "abc";
String b = "def";
String expected = "abcdef";
SomeInterface sut = new SomeImpl();
// Act
String actual = sut.concat(a, b);
// Assert
assertTrue(actual.equals(expected));
}
@Disabled("Test disabled")
@Test
void dummyTest2() {
assertTrue(false);
}
@AfterEach
public void afterEach() {
System.out.println("**** After Each");
}
@AfterAll
public static void afterAll() {
System.out.println("==== After All");
assertTrue(true);
}
}

View File

@@ -1,7 +1,5 @@
package com.r35157.libs.valuetypes.basic.tests;
import com.r35157.libs.valuetypes.basic.SomeInterface;
import com.r35157.libs.valuetypes.basic.impl.ref.SomeImpl;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
@@ -9,48 +7,9 @@ import static org.junit.jupiter.api.Assertions.*;
@DisplayName("Sad Initialization Tests")
public class SadInitializationTests {
@BeforeAll
public static void beforeAll() {
System.out.println("==== Before All");
}
@BeforeEach
public void beforeEach() {
System.out.println("---- Before Each");
}
@DisplayName("Just another basic test")
@Test
void anotherBasicTest() {
// Arrange + act
SomeInterface sut = new SomeImpl();
String expectedErrorMsg = "/ by zero";
ArithmeticException thrown = assertThrows(
ArithmeticException.class,
sut::divideByZero,
"Expected an exception to be thrown while dividing by zero, but it didn't"
);
String actualErrorMsg = thrown.getMessage();
// Assert
assertEquals(expectedErrorMsg, actualErrorMsg);
}
@Disabled("Test disabled")
@Test
void dummyTest2() {
assertTrue(false);
}
@AfterEach
public void afterEach() {
System.out.println("**** After Each");
}
@AfterAll
public static void afterAll() {
System.out.println("==== After All");
assertFalse(false);
}
}