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
7 merge requests!21Add Javadoc to GeneralBudget, and reworked method addBudget,!16Item, Income and Expense now use ObjectProperty for date and for Expense- and IncomeCategory,!15Implemented ObjectProperty for variable in Item, Income and in Expense class.,!14Item made variable date use LocalDate, and all other files support this change,!13Item changed object-variable date to use LocalDate, and made all other classes support this,!12Reworked Item class and Filehandling class, and made methods.,!10Improved and simplified code in FileHandling class
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