Testing: create test for tempSensorMockup #157

Closed
opened 2026-04-07 12:21:13 +00:00 by b24johka · 3 comments
Collaborator

Create tests for the cs file "Program.cs"

Create tests for the cs file "Program.cs"
b24johka added reference #157-test-tempSensor 2026-04-09 12:07:46 +00:00
Collaborator

Branch (pull-request) is closed and reviewed, should this issue still exist?

Branch (pull-request) is closed and reviewed, should this issue still exist?
Collaborator

Attempted to run test but test was unable to connect with the tempSensorMockup for some reason.
image

Reviewed written tests and code:
There is only one test, and all it does is validate that the data structure actually contains sensorId, timestamp and temperature. However, it does not establish the correctness of the datastructure, as no testing is performed to ensure that there are is extraneous data present, aka tags/data that shouldn't be there.

There also exists no tests to validate the actual data generated by the tempSensorMockup for either correct value types or allowed values and/or characters. I.E if temperature is inserted in place of the timestamp and vice versa, insertion of special characters, etc.

Recommendations:

  • Flesh out JsonData_TagsCorrect_ReturnTrue() test to ensure ONLY sensorId, timestamp and temperature tags exist.
  • Write additional tests for data validation.
Attempted to run test but test was unable to connect with the tempSensorMockup for some reason. ![image](/attachments/67e3e738-3117-42b0-9d7f-d8288109cf8d) Reviewed written tests and code: There is only one test, and all it does is validate that the data structure actually _contains_ **sensorId**, **timestamp** and **temperature**. However, it does not establish the correctness of the datastructure, as no testing is performed to ensure that there are is extraneous data present, aka tags/data that shouldn't be there. There also exists no tests to validate the actual data generated by the tempSensorMockup for either correct value types or allowed values and/or characters. I.E if temperature is inserted in place of the timestamp and vice versa, insertion of special characters, etc. Recommendations: - Flesh out JsonData_TagsCorrect_ReturnTrue() test to ensure ONLY **sensorId**, **timestamp** and **temperature** tags exist. - Write additional tests for **data validation**.
Author
Collaborator

This has been merged and a issue to extend the testing scope has been created #234

This has been merged and a issue to extend the testing scope has been created #234
Sign in to join this conversation.
No milestone
No project
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#157
No description provided.