Skip to content
Snippets Groups Projects
Commit 3f9a7362 authored by Balendra Sounthararajan's avatar Balendra Sounthararajan
Browse files

Merge branch 'additionalTest' into 'develop'

adding test to ensure that id in additional service cannot have negative id value

See merge request !17
parents e7381472 84ca5357
No related branches found
No related tags found
4 merge requests!71Added invoices test data,!30Had to edit the server port in Application properties due to default port 8080...,!27Had to edit the server port in Application properties due to default port 8080...,!17adding test to ensure that id in additional service cannot have negative id value
...@@ -4,7 +4,7 @@ import org.junit.jupiter.api.BeforeEach; ...@@ -4,7 +4,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.*;
/** /**
* Class for unit testing of Additional Service * Class for unit testing of Additional Service
...@@ -16,6 +16,7 @@ public class AdditionalServiceTest { ...@@ -16,6 +16,7 @@ public class AdditionalServiceTest {
AdditionalService addSer = new AdditionalService("change address", "additional service for changing the address", 10.0); AdditionalService addSer = new AdditionalService("change address", "additional service for changing the address", 10.0);
// ======================= POSITIVE TESTS ==============================
/** /**
* Tests that name of the additional service is correct - positive test. * Tests that name of the additional service is correct - positive test.
...@@ -45,6 +46,17 @@ public class AdditionalServiceTest { ...@@ -45,6 +46,17 @@ public class AdditionalServiceTest {
assertEquals(10.0, addSer.getCost()); assertEquals(10.0, addSer.getCost());
} }
// ======================= NEGATIVE TESTS ==============================
/**
* Testing that negative id values in test fail - negative test.
*/
@Test
@DisplayName("checking that negative id fails - negative test")
void additionalServiceIdIsIncorrectTest() {
addSer.setId(-1);
assertTrue(addSer.getId() != -1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment