Updated test in JsonData.test.cs #456

Closed
a24nedka wants to merge 0 commits from #406-tempSensorMockup-fix into team_2_week_2
Collaborator

-The tests were failing due to a change in the response structure of the temperature endpoint, which now returns an array instead of a single object.

-The test is updated so it iterate over the array and validate each item.

-The test passes now.

Issue: #406

-The tests were failing due to a change in the response structure of the temperature endpoint, which now returns an array instead of a single object. -The test is updated so it iterate over the array and validate each item. -The test passes now. Issue: #406
Updated tempSensorMockup tests to iterate over the array response and validate each object.

It's applied to  each item in the array. Passes all 4 tests now
Collaborator

Review on #456

What’s done
I checked that the test in JsonData.test.cs was updated to handle the new response structure from the /temperature endpoint.

Tested on Windows using PowerShell

Running dotnet test from the repo root did not work because of project/solution reference issues in this branch
I instead ran the relevant test project directly:
dotnet test .\generateMockup\tempSensorMockup\tempSensorMockup.Tests\tempSensorMockup.Tests.csproj
All tests pass (4/4)
Only warnings related to MQTTnet showed up

Inspected file

generateMockup/tempSensorMockup/tempSensorMockup.Tests/JsonData.test.cs

Code review
The test has been updated to validate an array response instead of a single object, which matches the PR description. The checks for sensorId, timestamp, and temperature are still covered, and the relevant test project passes.

There are a couple of minor things that could be cleaned up, like unused using statements and some formatting inconsistencies, but nothing that looks blocking.

Conclusion
I think this is ready to be merged.

Review on #456 What’s done I checked that the test in JsonData.test.cs was updated to handle the new response structure from the /temperature endpoint. Tested on Windows using PowerShell Running dotnet test from the repo root did not work because of project/solution reference issues in this branch I instead ran the relevant test project directly: dotnet test .\generateMockup\tempSensorMockup\tempSensorMockup.Tests\tempSensorMockup.Tests.csproj All tests pass (4/4) Only warnings related to MQTTnet showed up Inspected file generateMockup/tempSensorMockup/tempSensorMockup.Tests/JsonData.test.cs Code review The test has been updated to validate an array response instead of a single object, which matches the PR description. The checks for sensorId, timestamp, and temperature are still covered, and the relevant test project passes. There are a couple of minor things that could be cleaned up, like unused using statements and some formatting inconsistencies, but nothing that looks blocking. Conclusion I think this is ready to be merged.
Collaborator

Manually Merged, well done!

Manually Merged, well done!
a24vinla closed this pull request 2026-04-22 06:27:30 +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!456
No description provided.