Marking soon to be removed methods in the fluent api as obsolete#362
Merged
alexanderlinne merged 9 commits intoTNG:mainfrom Apr 28, 2025
Merged
Conversation
…nt API. Instead, an IObjectProvider should be used (e.g. Types().That().HaveFullNameMatching(...)), since this allows for more flexiblity and is much clearer, what you are matching against. Added TODOs to split the methods for matching names with string into separate methods for regex and string equality. Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
…oads of fluent methods were removed Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
…le<IType> types), which was equal to HaveDependencyInMethodBodyTo(IEnumerable<IType> types) Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
…hod parameter to change between string equality checks and regex matching by two separate methods. Removed some more redundant methods in the Fluent API with strings as arguments, that can be replaced by equivalent expressions by invoking the method with an IObjectProvider created by the fluent syntax. Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
…pected test output Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
…ark them as obsolete Signed-off-by: Fritz Brandhuber <fritz.brandhuber@tngtech.com>
…hods # Conflicts: # ArchUnitNET/Domain/Extensions/AttributeExtensions.cs # ArchUnitNET/Domain/Extensions/DependencyExtensions.cs # ArchUnitNET/Domain/Extensions/MemberExtensions.cs # ArchUnitNET/Fluent/Syntax/Elements/Types/GivenTypesThat.cs
5473f5d to
fbdd7f0
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
- Coverage 65.61% 57.39% -8.23%
==========================================
Files 255 255
Lines 23033 23632 +599
Branches 1961 1985 +24
==========================================
- Hits 15114 13563 -1551
- Misses 7374 9595 +2221
+ Partials 545 474 -71 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
alexanderlinne
approved these changes
Apr 25, 2025
This was referenced Jul 23, 2025
This was referenced Jan 23, 2026
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.
Marked all methods where
useRegularExpressionswas used as a parameter to change between string equality checks and regex matching as obsolete and added separate methods to replace them (e.g.HaveName(string pattern, bool useRegularExpressions = false)is replaced byHaveName(string name)andHaveNameMatching(string pattern))Marked redundant overloads with string parameters from some methods in the Fluent API as obsolete, where an IObjectProvider can be used instead to create an equivalent or more precisely defined rule (e.g.
Types().That().DependOnAny("ExampleClass"), which can be replaced byTypes().That().DependOnAny(Types().That().HaveName("ExampleClass"))).Fixed a bug in the implementation of
NotHaveDependencyInMethodBodyTo(IEnumerable<IType> types)inMethodMemberConditionsDefinition, which resulted in the method behaving like the negationHaveDependencyInMethodBodyTo(IEnumerable<IType> types).