Browse Source

refactoring: adjusting test functions to the naming conventions in class AdminTest

remotes/origin/fdai7780
Tobias Herbert 11 months ago
parent
commit
1ce94ba809
  1. 6
      src/test/java/org/example/AdminTest.java

6
src/test/java/org/example/AdminTest.java

@ -30,7 +30,7 @@ class AdminTest {
//Tests printAdminInfo Method //Tests printAdminInfo Method
@org.junit.jupiter.api.Test @org.junit.jupiter.api.Test
void printAdminInfo() {
void testPrintAdminInfo() {
Admin admin = new Admin("Aaron", "A1001", "Admin"); Admin admin = new Admin("Aaron", "A1001", "Admin");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@ -47,7 +47,7 @@ class AdminTest {
} }
//Tests writeToFile Method //Tests writeToFile Method
@Test @Test
void writeToFile() throws IOException {
void testWriteToFile() throws IOException {
Admin admin = new Admin("Simon", "A1001", "Admin") ; Admin admin = new Admin("Simon", "A1001", "Admin") ;
admin.writeToFile(admin, fileName()); admin.writeToFile(admin, fileName());
@ -59,7 +59,7 @@ class AdminTest {
} }
//Tests readFromFile Method //Tests readFromFile Method
@Test @Test
void readFromFile() throws IOException {
void testReadFromFile() throws IOException {
try (PrintWriter writer = new PrintWriter(new FileWriter("testAdminData.txt"))){ try (PrintWriter writer = new PrintWriter(new FileWriter("testAdminData.txt"))){
writer.println("Thomas"); writer.println("Thomas");

Loading…
Cancel
Save