Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

SuccessComments
1getAllGraphs()

Returns a GraphsDTO with the following information.

GraphsDTO{

name = "test"

tabID =  1

id = 1

}


Returns the expected list of DTOs.YesThe 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.
2addGraph()Throws a DatabaseException.

tabID = 1

graphID = 1

graphType = "linechart"

A DatabaseException is thrown.YesThe 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

Wrong exception

Name

Expected result

Parameters

Actual result

Success

Comments

1getGraphs()All graphs with tabID are shown.tabID = 1All graphs with the given tabID, are returned to the user.Yes
2getUserTabsSqlException()A databaseException will be thrown after a SQLException. tabID = 1A SQLException is thrown.Yes
3addGraphsTestSqlException()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

SuccessComments
1getAllRaces()

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.YesThe 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.

...