NoIssue: Clean-up
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
package com.r35157.libs.random.tests;
|
||||
|
||||
import com.r35157.libs.random.SomeInterface;
|
||||
import com.r35157.libs.random.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");
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.r35157.libs.random.tests;
|
||||
|
||||
import com.r35157.libs.random.SomeInterface;
|
||||
import com.r35157.libs.random.impl.ref.SomeImpl;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user