Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use AutoDomainData attribute instead of directly mocking with NSubstitute #648

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

vbreuss
Copy link
Member

@vbreuss vbreuss commented Sep 14, 2024

Add a custom AutoDomainData extension of AutoDataAttribute, that uses NSubstitute and allows for domain-specific customizations.

In order to apply a customization for all tests in a project, add a class implementing the IAutoDataCustomization interface. This customization is then applied to all tests using the [AutoDomainData] attribute.

Additionally this attribute has a property CustomizeWith which can point to a class implementing the ICustomization interface and which is then applied to this test only.

@vbreuss vbreuss added the refactor A change or improvement without functional impact label Sep 14, 2024
@vbreuss vbreuss self-assigned this Sep 14, 2024
Copy link

sonarcloud bot commented Sep 14, 2024

@vbreuss vbreuss enabled auto-merge (squash) September 14, 2024 13:57
Copy link

Stryker.NET mutation tested the changes in the pull request:
Mutation testing badge

@vbreuss vbreuss merged commit 53ffd69 into main Sep 14, 2024
13 checks passed
@vbreuss vbreuss deleted the topic/use-auto-domain-data-attribute branch September 14, 2024 14:07
Copy link

This is addressed in release v3.2.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A change or improvement without functional impact state: released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant