Skip to content
Snippets Groups Projects
Commit 0e9e3fb3 authored by Andreas's avatar Andreas
Browse files

Deleted ItemTest

parent 99fa8f06
No related branches found
No related tags found
1 merge request!5Created register for storing information on Income and Expense
Pipeline #204644 passed
......@@ -21,6 +21,32 @@ class IncomeTest {
void constructorDoesThrow() {
assertDoesNotThrow(() -> new Income("description", 59.9f, false, IncomeCategory.SALARY, "03.03.23"));
}
}
}
\ No newline at end of file
/**
* package no.ntnu.idatt1002.demo.data.Economics;
*
* import no.ntnu.idatt1002.demo.data.Economics.Item;
* import org.junit.jupiter.api.DisplayName;
* import org.junit.jupiter.api.Test;
*
* import static org.junit.jupiter.api.Assertions.*;
*
* class ItemTest {
*
* @Test
* @DisplayName("The Item constructor throws exceptions when it should.")
* void constructorThrows(){
* assertThrows(IllegalArgumentException.class, () -> new Item("description", 0f, false, "03.03.23"));
* assertThrows(IllegalArgumentException.class, () -> new Item("description", -10.0f, false, "03.03.23"));
* assertThrows(IllegalArgumentException.class, () -> new Item("description", -10.0f, false, ""));
* };
*
* @Test
* @DisplayName("The Item constructor does not throw exceptions when it should not.")
* void constructorDoesThrow() {
* assertDoesNotThrow(() -> new Item("description", 59.9f, false, "03.03.23"));
* }
*
* }
*/
\ No newline at end of file
package no.ntnu.idatt1002.demo.data.Economics;
import no.ntnu.idatt1002.demo.data.Economics.Item;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class ItemTest {
@Test
@DisplayName("The Item constructor throws exceptions when it should.")
void constructorThrows(){
assertThrows(IllegalArgumentException.class, () -> new Item("description", 0f, false, "03.03.23"));
assertThrows(IllegalArgumentException.class, () -> new Item("description", -10.0f, false, "03.03.23"));
assertThrows(IllegalArgumentException.class, () -> new Item("description", -10.0f, false, ""));
};
@Test
@DisplayName("The Item constructor does not throw exceptions when it should not.")
void constructorDoesThrow() {
assertDoesNotThrow(() -> new Item("description", 59.9f, false, "03.03.23"));
}
}
\ No newline at end of file
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