Skip to content

Conversation

brandhuf
Copy link
Contributor

@brandhuf brandhuf commented Apr 7, 2025

Marked all methods where useRegularExpressions was 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 by HaveName(string name) and HaveNameMatching(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 by Types().That().DependOnAny(Types().That().HaveName("ExampleClass"))).

Fixed a bug in the implementation of NotHaveDependencyInMethodBodyTo(IEnumerable<IType> types) in MethodMemberConditionsDefinition, which resulted in the method behaving like the negation HaveDependencyInMethodBodyTo(IEnumerable<IType> types).

…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 <[email protected]>
…oads of fluent methods were removed

Signed-off-by: Fritz Brandhuber <[email protected]>
…le<IType> types), which was equal to HaveDependencyInMethodBodyTo(IEnumerable<IType> types)

Signed-off-by: Fritz Brandhuber <[email protected]>
…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 <[email protected]>
Signed-off-by: Fritz Brandhuber <[email protected]>
…hods

# Conflicts:
#	ArchUnitNET/Domain/Extensions/AttributeExtensions.cs
#	ArchUnitNET/Domain/Extensions/DependencyExtensions.cs
#	ArchUnitNET/Domain/Extensions/MemberExtensions.cs
#	ArchUnitNET/Fluent/Syntax/Elements/Types/GivenTypesThat.cs
@brandhuf brandhuf force-pushed the remove_string_overloads_from_most_fluent_methods branch from 5473f5d to fbdd7f0 Compare April 25, 2025 08:43
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 46.94534% with 330 lines in your changes missing coverage. Please review.

Project coverage is 57.39%. Comparing base (850064c) to head (55ec99f).

Files with missing lines Patch % Lines
...luent/Syntax/Elements/ShouldRelateToObjectsThat.cs 0.00% 48 Missing ⚠️
...t/Syntax/Elements/Types/ShouldRelateToTypesThat.cs 0.00% 48 Missing ⚠️
ArchUnitNET/Domain/Extensions/TypeExtensions.cs 35.41% 29 Missing and 2 partials ⚠️
.../Syntax/Elements/Types/TypeConditionsDefinition.cs 50.87% 28 Missing ⚠️
ArchUnitNET/Domain/Extensions/MemberExtensions.cs 0.00% 26 Missing ⚠️
...UnitNET/Fluent/Syntax/Elements/GivenObjectsThat.cs 42.85% 24 Missing ⚠️
...uent/Syntax/Elements/ObjectPredicatesDefinition.cs 50.00% 24 Missing ⚠️
...NET/Fluent/Syntax/Elements/Types/GivenTypesThat.cs 50.00% 24 Missing ⚠️
.../Syntax/Elements/Types/TypePredicatesDefinition.cs 50.00% 24 Missing ⚠️
...nitNET/Fluent/Syntax/Elements/Types/TypesShould.cs 50.00% 24 Missing ⚠️
... and 3 more

❗ There is a different number of reports uploaded between BASE (850064c) and HEAD (55ec99f). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (850064c) HEAD (55ec99f)
2 1
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexanderlinne alexanderlinne added this to the 0.12.0 milestone Apr 25, 2025
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