improved UnitTests for vendors MouldKing, JIESTAR, PowerFunctions and CaDA.#239
Open
J0EK3R wants to merge 8 commits into
Open
improved UnitTests for vendors MouldKing, JIESTAR, PowerFunctions and CaDA.#239J0EK3R wants to merge 8 commits into
J0EK3R wants to merge 8 commits into
Conversation
vicocz
reviewed
Jul 7, 2026
There was a problem hiding this comment.
Pull request overview
This PR refactors and expands the DI-focused unit tests around vendor/device registration by switching from direct VendorBuilder registration tests to tests that exercise the real Autofac module wiring via RegisterAssemblyModules<TVendor>(...), aiming to catch dependency-resolution issues earlier.
Changes:
- Replaced the previous
VendorBuilderTestswith vendor-specific tests that build a container and resolve devices viaDeviceFactory. - Added DI integration tests for MouldKing and JIESTAR (and additionally CaDA and PowerFunctions) to validate successful resolution and expected failure modes.
- Standardized test setup to mimic production DI behavior (keyed device resolution + named parameters) more closely.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| BrickController2/BrickController2.Tests/DeviceManagement/DI/VendorBuilderTests.cs | Removed legacy VendorBuilder-centric tests in favor of module-based DI coverage. |
| BrickController2/BrickController2.Tests/DeviceManagement/DI/PowerFunctionsVendorTests.cs | Adds module-based DI test ensuring PowerFunctionsDevice can be resolved via DeviceFactory. |
| BrickController2/BrickController2.Tests/DeviceManagement/DI/MouldKingVendorTests.cs | Adds module-based DI tests covering MK device registrations and expected illegal-address failures. |
| BrickController2/BrickController2.Tests/DeviceManagement/DI/JieStarVendorTests.cs | Adds module-based DI tests covering SCM4/SCM8 registrations and expected illegal-address failures. |
| BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs | Adds module-based DI tests for CaDARaceCar, including invalid deviceData-size failure behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've improved the UnitTests for vendors MouldKing and JIESTAR by using AssemblyModules-DI.
These unit tests would have exposed the dependency‑resolution bug.