...
One of the requirements from Regterschot Racing was that the application needs to be safe, so that no-one is allowed on the appplication, except for those with the permission to be in the application.
The code also needs to work and be well documented. This document will show which code works and what all the tests are. If there is a failed test, it will be explained on why this happens.
Graph tests
GraphServiceTest class
Name | Expected result | Parameters | Actual result | Success | Comments | |
---|---|---|---|---|---|---|
1 | getAllGraphs() | Returns a GraphsDTO with the following information. GraphsDTO{ name = "test" tabID = 1 id = 1 } | Returns the expected list of DTOs. | Yes | The response from the DAO is set manually, because a connection to the real database is not safe in tests. The response is the same GraphsDTO, to see if the getter works en returns the list from GraphDAO. | |
2 | addGraph() | Throws a DatabaseException. | tabID = 1 graphID = 1 graphType = "linechart" | A DatabaseException is thrown. | Yes | The return value cannot be tested, since this method returns a void. That is why the Exception is checked, instead of a return value. |
GraphDAOTest class
Name | Expected result | Parameters | Actual result | Success | Comments | ||
---|---|---|---|---|---|---|---|
1 | getGraphs() | All graphs with tabID are shown. | tabID = 1 | All graphs with the given tabID, are returned to the user. | Yes | ||
2 | getUserTabsSqlException() | A databaseException will be thrown after a SQLException. | tabID = 1 | A SQLException is thrown. | Yes | Wrong exception||
3 | addGraphsTestSqlException() | A databaseException will be thrown after a SQLException. | tabID = 1 graphID = 1 graphType = "Linechart" | A SQLException is thrown. | Yes |
Table 1: Tests in GraphDAOTest
...
Name | Expected result | Parameters | Actual result | Success | Comments | |
---|---|---|---|---|---|---|
1 | getAllRaces() | Returns a RaceDTo with the following informationlist of DTO's. In this case we only put the following DTO inside the list. RaceDTO{ raceID = 1 raceName = "BMW Race" date = "2022-05-22" } | Returns the expected RaceDTO. | Yes | The response from the database DAO is set manually, because a connection to the real database is not safe in tests. The response is the same RaceDTO, to see if the getter works en returns the list from RaceDAO. |
...