Skip to content

Conversation

@brandhuf
Copy link
Contributor

Replaced all occurences where useRegularExpressions was used as a method parameter to change between string equality checks and regex matching by two separate methods (e.g. HaveName(string pattern, bool useRegularExpressions = false) is replaced by HaveName(string name) and HaveNameMatching(string pattern))

Removed redundant overloads with string parameters from some methods in the Fluent API, where an IObjectProvider can be used instead to create an equivalent or more precisely defined rule (e.g. Types().That().DependOnAny("ExampleClass") 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.
…le<IType> types), which was equal to HaveDependencyInMethodBodyTo(IEnumerable<IType> types)
…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.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 46.83544% with 252 lines in your changes missing coverage. Please review.

Project coverage is 69.20%. Comparing base (2cbfd10) to head (b588744).
Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
ArchUnitNET/Domain/Extensions/TypeExtensions.cs 24.32% 27 Missing and 1 partial ⚠️
...luent/Syntax/Elements/ShouldRelateToObjectsThat.cs 0.00% 28 Missing ⚠️
...uent/Syntax/Elements/ObjectPredicatesDefinition.cs 39.02% 25 Missing ⚠️
...t/Syntax/Elements/Types/ShouldRelateToTypesThat.cs 3.84% 25 Missing ⚠️
ArchUnitNET/Domain/Extensions/MemberExtensions.cs 4.00% 24 Missing ⚠️
.../Syntax/Elements/Types/TypePredicatesDefinition.cs 29.41% 24 Missing ⚠️
...UnitNET/Fluent/Syntax/Elements/GivenObjectsThat.cs 30.00% 21 Missing ⚠️
.../Syntax/Elements/Types/TypeConditionsDefinition.cs 42.42% 19 Missing ⚠️
...nitNET/Fluent/Syntax/Elements/Types/TypesShould.cs 39.28% 17 Missing ⚠️
...NET/Fluent/Syntax/Elements/Types/GivenTypesThat.cs 44.82% 16 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #353      +/-   ##
==========================================
+ Coverage   65.65%   69.20%   +3.54%     
==========================================
  Files         255      255              
  Lines       23032    19644    -3388     
  Branches     1962     1680     -282     
==========================================
- Hits        15121    13594    -1527     
+ Misses       7366     5576    -1790     
+ 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.

@brandhuf brandhuf closed this Apr 7, 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.

2 participants