#234-Extend-the-test-scope-for-tempSensorMockup #255

Closed
f21marfo wants to merge 0 commits from #234-Extend-the-test-scope-for-tempSensorMockup into temp-week-2-merge-branch
Collaborator

Completed unit test suite for tempSensorMockup

  • Validates the data-structure returned by the endpoint.
  • Individually validates the validity of the data for each returned datatype, sensorId, timestamp, temperature.
Completed unit test suite for tempSensorMockup - Validates the data-structure returned by the endpoint. - Individually validates the validity of the data for each returned datatype, sensorId, timestamp, temperature.
The existing test for tempSensorMockup was not a true unit test, and had issues connecting to to the running api in the docker container.

Imported package Microsoft.AspNetCore.Mvc.Testing in order to use the WebApplicationFactory() to create an in-memory copy of the tempSensorMockup so that it can be correctly tested.
JsonData_TagsCorrect_ReturnTrue() will now accurately validate the data structure of tempSensorMockup.

It will fail for the following:
- If the parsed JSON contains ANY unexpected property names.
- If the parsed JSON has to few or too many properties.

Todo: Data validation
Enhanced the test to establish the uniqueness of the returned JSON properties. Example: A faulty JSON that has the property Data occurring twice, will fail the test, rather than being waved through.
- Extended unit tests to validate each of the expected three values.
- Refactored all tests to try and conform with unit test guidelines, as best as possible by subdividing the data validation tests and structuring them in accordance with the three "A's", where possible.
Collaborator

read through the test code and related PR description
checked that the validated JSON fields are descriptive and follow camelCase (sensorId, timestamp, temperature)
resolved the merge conflicts locally by keeping the test files from this PR
ran the test suite with dotnet test the resykt: the project built successfully
all 4 tests passed. The JSON validation in the test suite appears to work as expected with the local conflict resolution

read through the test code and related PR description checked that the validated JSON fields are descriptive and follow camelCase (sensorId, timestamp, temperature) resolved the merge conflicts locally by keeping the test files from this PR ran the test suite with dotnet test the resykt: the project built successfully all 4 tests passed. The JSON validation in the test suite appears to work as expected with the local conflict resolution
b24johka changed target branch from team_1_week_1 to temp-week-2-merge-branch 2026-04-15 09:17:41 +00:00
Collaborator

This has been manually merged to temporary merge branch

This has been manually merged to temporary merge branch
b24johka closed this pull request 2026-04-15 11:28:29 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!255
No description provided.