Skip to content

improved UnitTests for vendors MouldKing, JIESTAR, PowerFunctions and CaDA.#239

Open
J0EK3R wants to merge 8 commits into
vicocz:defaultfrom
J0EK3R:merge/vicocz/improved_unittests_vender
Open

improved UnitTests for vendors MouldKing, JIESTAR, PowerFunctions and CaDA.#239
J0EK3R wants to merge 8 commits into
vicocz:defaultfrom
J0EK3R:merge/vicocz/improved_unittests_vender

Conversation

@J0EK3R

@J0EK3R J0EK3R commented Jul 6, 2026

Copy link
Copy Markdown

I've improved the UnitTests for vendors MouldKing and JIESTAR by using AssemblyModules-DI.

These unit tests would have exposed the dependency‑resolution bug.

@vicocz vicocz requested a review from Copilot July 7, 2026 18:59
Comment thread BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs Outdated
Comment thread BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs Outdated
Comment thread BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs Outdated
Comment thread BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 VendorBuilderTests with vendor-specific tests that build a container and resolve devices via DeviceFactory.
  • 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.

Comment thread BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs Outdated
Comment thread BrickController2/BrickController2.Tests/DeviceManagement/DI/CaDAVendorTests.cs Outdated
@J0EK3R J0EK3R changed the title improved UnitTests for vendors MouldKing and JIESTAR improved UnitTests for vendors MouldKing, JIESTAR, PowerFunctions and CaDA. Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants