diff --git a/src/main/resources/Economics/expenseRegisterTest.register b/src/main/resources/Economics/expenseRegisterTest.register new file mode 100644 index 0000000000000000000000000000000000000000..c7d084112c6de671e412d5e185da4f5aee5a0327 --- /dev/null +++ b/src/main/resources/Economics/expenseRegisterTest.register @@ -0,0 +1,6 @@ +date=03.03.23 +description=description +amount=59.900001525878906 +isReoccuring=Not reoccurring +category=CLOTHES + diff --git a/src/main/resources/Economics/incomeRegisterTest.register b/src/main/resources/Economics/incomeRegisterTest.register new file mode 100644 index 0000000000000000000000000000000000000000..0b3082def4aa9d25e83b22a1dbc298bcb85459ba --- /dev/null +++ b/src/main/resources/Economics/incomeRegisterTest.register @@ -0,0 +1,6 @@ +date=03.03.23 +description=description +amount=59.900001525878906 +isReoccuring=Not reoccurring +category=GIFT + diff --git a/src/test/java/no/ntnu/idatt1002/demo/data/Economics/ExpenseTest.java b/src/test/java/no/ntnu/idatt1002/demo/data/Economics/ExpenseTest.java index 338f63fb563e843c1871674e6043528cc89b9894..191c8513b06596eac7682e78dbb2ad21ee95f56c 100644 --- a/src/test/java/no/ntnu/idatt1002/demo/data/Economics/ExpenseTest.java +++ b/src/test/java/no/ntnu/idatt1002/demo/data/Economics/ExpenseTest.java @@ -1,7 +1,5 @@ package no.ntnu.idatt1002.demo.data.Economics; -import no.ntnu.idatt1002.demo.data.Economics.Expense; -import no.ntnu.idatt1002.demo.data.Economics.ExpenseCategory; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -14,7 +12,7 @@ class ExpenseTest { void constructorThrows(){ assertThrows(IllegalArgumentException.class, () -> new Expense("description", 8.5f, false, null, "03.03.23")); assertThrows(IllegalArgumentException.class, () -> new Expense("description", -10.0f, false, ExpenseCategory.BOOKS, "03.03.23")); - }; + } @Test @DisplayName("The Expense constructor does not throw exceptions when it should not.") diff --git a/src/test/java/no/ntnu/idatt1002/demo/data/Economics/FileHandlingTest.java b/src/test/java/no/ntnu/idatt1002/demo/data/Economics/FileHandlingTest.java index aaa5097a4291ee0d4f9c9793f5c0119a5bfb8702..59ffe36701caa1eee0832678c4b41a3a16b43b8f 100644 --- a/src/test/java/no/ntnu/idatt1002/demo/data/Economics/FileHandlingTest.java +++ b/src/test/java/no/ntnu/idatt1002/demo/data/Economics/FileHandlingTest.java @@ -23,7 +23,7 @@ class FileHandlingTest { } @Test @DisplayName("Writing to file does not throw exception") - void writingToFileDoesNotThrowException() throws IOException { + void writingToFileDoesNotThrowException() { assertDoesNotThrow(()->fileHandling.writeItemRegisterToFile(incomeRegister, fileTitle)); } @@ -43,7 +43,7 @@ class FileHandlingTest { } @Test @DisplayName("Writing to file does not throw exception") - void writingToFileDoesNotThrowException() throws IOException { + void writingToFileDoesNotThrowException() { assertDoesNotThrow(()->fileHandling.writeItemRegisterToFile(incomeRegister, fileTitle)); } @@ -67,7 +67,7 @@ class FileHandlingTest { } @Test @DisplayName("Writing to file does not throw exception") - void writingToFileDoesNotThrowException() throws IOException { + void writingToFileDoesNotThrowException() { assertDoesNotThrow(()->fileHandling.writeItemRegisterToFile(incomeRegister, fileTitle)); } @@ -92,7 +92,7 @@ class FileHandlingTest { } @Test @DisplayName("Writing to file does not throw exception") - void writingToFileDoesNotThrowException() throws IOException { + void writingToFileDoesNotThrowException() { assertDoesNotThrow(()->fileHandling.writeItemRegisterToFile(expenseRegister, fileTitle)); } @@ -112,7 +112,7 @@ class FileHandlingTest { } @Test @DisplayName("Writing to file does not throw exception") - void writingToFileDoesNotThrowException() throws IOException { + void writingToFileDoesNotThrowException() { assertDoesNotThrow(()->fileHandling.writeItemRegisterToFile(expenseRegister, fileTitle)); } @@ -137,7 +137,7 @@ class FileHandlingTest { } @Test @DisplayName("Writing to file does not throw exception") - void writingToFileDoesNotThrowException() throws IOException { + void writingToFileDoesNotThrowException() { assertDoesNotThrow(()->fileHandling.writeItemRegisterToFile(expenseRegister, fileTitle)); }