716-Energy-Tests #1113

Merged
a24julot merged 5 commits from 716-Energy-Tests into team_1_week_7 2026-05-25 11:57:21 +00:00
Collaborator

Big PR? on the last 2 days? with multiple brand new complicated tolls??? all true and a classic 😄

related issue #716

Giga pull request, i tried to be as detailed as possible in code comments as its alot of information to share here. Essentially a functional creation of integration testing with real databases using xunit, ASP core and testcontainers. Not alot of tests were added, but i dont have enough time to do everything so i focused on making the bigger checks (integration and http requests possible) fututre developers will be able to look at this and expand and create integration tests for other services similar to energy

you can also make unit tests with this, as that is just test desing strcucture but using real databases for unit tests is kinda overkill, possible but maybe look more to the moq side of testing for that, but i included test examples for both unit and integration.

Monday is full focus on creating a wiki page for this to explain functions to future developers

to run tests go cd into energyService.Tests and just run dotnet test (sudo dotnet tests if you access errors) in the terminal

Big PR? on the last 2 days? with multiple brand new complicated tolls??? all true and a classic 😄 related issue #716 Giga pull request, i tried to be as detailed as possible in code comments as its alot of information to share here. Essentially a functional creation of integration testing with real databases using xunit, ASP core and testcontainers. Not alot of tests were added, but i dont have enough time to do everything so i focused on making the bigger checks (integration and http requests possible) fututre developers will be able to look at this and expand and create integration tests for other services similar to energy you can also make unit tests with this, as that is just test desing strcucture but using real databases for unit tests is kinda overkill, possible but maybe look more to the moq side of testing for that, but i included test examples for both unit and integration. Monday is full focus on creating a wiki page for this to explain functions to future developers to run tests go cd into energyService.Tests and just run dotnet test (sudo dotnet tests if you access errors) in the terminal
(i swear to good if the problem noticed is not a minor thing i will HASDASDASCXAS)a'osdd
let it be known if we EVER go to Xunit version 3 or beyond we must install a  Testcontainer.Xunit3 instead of the current Testcontainer.Xunit, this is documented on Testcontainres xunit pages
we need to do
added clearifying comments for the energyservices Program.cs file
a24sakma left a comment
Collaborator

The tests looks good as base start on how to create an integration test:

  1. There has been a discussion with the developer about improving comment
  2. adding readme into test mappen
  3. further development issues what can be done more

after that is done. I can approve this pr

The tests looks good as base start on how to create an integration test: 1. There has been a discussion with the developer about improving comment 2. adding readme into test mappen 3. further development issues what can be done more after that is done. I can approve this pr
@ -58,3 +58,4 @@ app.UseAuthorization();
*/
EnergyEndpoints.MapEnergyEndpoints(app);
app.Run();
public partial class Program { }
Collaborator

add a comment here why this is needed for the test so that it is clear when we handover to next group

add a comment here why this is needed for the test so that it is clear when we handover to next group
a24sakma marked this conversation as resolved
Author
Collaborator

created new issues
added clarifying comments
added a read me explaining how to run tests and know errors and how to solve them

created new issues added clarifying comments added a read me explaining how to run tests and know errors and how to solve them
a24sakma approved these changes 2026-05-25 11:03:58 +00:00
a24sakma left a comment
Collaborator

Great!
Very good job!
Now we have a good base for integration test that is implemented and actually works.

Great! Very good job! Now we have a good base for integration test that is implemented and actually works.
a24julot merged commit 955bd68e9c into team_1_week_7 2026-05-25 11:57:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!1113
No description provided.