Skip to content
Snippets Groups Projects
Commit 385a0861 authored by Andreas's avatar Andreas
Browse files

Added test textfiles for Filehandling

parent 0ed38f88
No related branches found
No related tags found
Loading
Pipeline #210271 passed
date=03.03.23
description=description
amount=59.900001525878906
isReoccuring=Not reoccurring
category=CLOTHES
date=03.03.23
description=description
amount=59.900001525878906
isReoccuring=Not reoccurring
category=GIFT
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.")
......
......@@ -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));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment