Skip to content

Fixed test case generation in cases of unfulfillable demands#89

Merged
TonyTroeff merged 3 commits intomainfrom
troeff/fix-demands-computation
Apr 22, 2026
Merged

Fixed test case generation in cases of unfulfillable demands#89
TonyTroeff merged 3 commits intomainfrom
troeff/fix-demands-computation

Conversation

@TonyTroeff
Copy link
Copy Markdown
Member

Pull Request Description

If there are unfulfillable demands, no test cases will be generated. Everything else should work as expected.

Motivation and Context

This PR fixes #86.

Checklist

  • I have tested these changes thoroughly.
  • I have added/updated relevant documentation.
  • My code follows the project's coding guidelines.
  • I have performed a self-review of my changes.
  • My changes are backwards compatible.

@TonyTroeff TonyTroeff added this to the 1.2.0 milestone Apr 22, 2026
@TonyTroeff TonyTroeff self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 11:02
@TonyTroeff TonyTroeff added the bug Something isn't working label Apr 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes test discovery so that when requirements exist but no utilities remain after applying demands, no test cases are generated/discovered (addresses #86).

Changes:

  • Added the ability to register an initialization category with zero values (Register(category)), and updated collection construction sites to use it.
  • Updated discovery/assembly-data/serialization/dependency-building paths to ensure required categories are present even when filtered to empty.
  • Added unit tests covering “no test cases when all required utilities are filtered out” and “single test case when nothing is required”.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
TryAtSoftware.CleanTests.Core/XUnit/Serialization/SerializableInitializationUtility.cs Ensures demand categories are registered before adding demand entries during deserialization.
TryAtSoftware.CleanTests.Core/XUnit/Discovery/CleanTestFrameworkDiscoverer.cs Registers required categories even if no matching utilities exist, preventing combinations/testcases from being generated.
TryAtSoftware.CleanTests.Core/XUnit/CleanTestAssemblyData.cs Registers utility categories explicitly before registering utilities.
TryAtSoftware.CleanTests.Core/Interfaces/ICleanTestInitializationCollection.cs Adds Register(string category) to support empty-category registration.
TryAtSoftware.CleanTests.Core/Extensions/CleanTestsFrameworkExtensions.cs Ensures categories are registered before copying/registering values; registers demand categories when extracting demands.
TryAtSoftware.CleanTests.Core/Construction/ConstructionManager.cs Registers dependency categories before adding dependencies.
TryAtSoftware.CleanTests.Core/CleanTestInitializationCollection.cs Implements Register(category); adjusts Register(category, value) behavior accordingly.
Tests/TryAtSoftware.CleanTests.UnitTests/Parametrization/EnvironmentSetup.cs Updates test setup helpers to register categories before adding per-category values.
Tests/TryAtSoftware.CleanTests.UnitTests/CleanUtilitiesDistributionTests.cs Adds regression tests for discovery behavior when demands filter out all required utilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TryAtSoftware.CleanTests.Core/CleanTestInitializationCollection.cs
@sonarqubecloud
Copy link
Copy Markdown

@TonyTroeff TonyTroeff modified the milestones: 1.2.0, 1.1.1 Apr 22, 2026
@TonyTroeff TonyTroeff merged commit ecb2e93 into main Apr 22, 2026
2 checks passed
@TonyTroeff TonyTroeff deleted the troeff/fix-demands-computation branch April 22, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No clean utilities match the test demands but still test cases are generated

2 participants