Releases: BenMorris/NetArchTest
v1.3.2
String literals are only checked on the HaveDependencyOnAny and HaveDependencyOnAll methods. This will minimise the risk of any false positives arising from the string literal checking behaviour that was re-introduced in v1.3.1 (#94)
Fixed an issue where the dependency search was not consistently checking whether a type has a dependency on itself (#95)
Removed some unnecessary dependencies from the project (#93)
v1.3.1
Checking for static classes added via new predicates (AreStatic and AreNotStatic) and conditions (BeStatic, NotBeStatic) (#89).
The dependency search now checks for dependenices in string literals (this is restored functionality lost in versionn 1.2.6 (#79, #82).
Compiler-generated types that are located outside of any namespace should not be detected by the dependency search (#78).
Updated the Mono.Cecil dependency to the latest version (#87).
Thanks for @RyanMarcotte, @Lorilatschki and @NeVeSpl, and @tibel for the pull requests.
v1.3.0
A significant rewrite of dependency searches which has improved performance and accuracy of searches. This fixed a number of problems including finding dependencies in attributes, generic dependencies, implemented interfaces, generic constraints, arrays, reference types and pointers (see #62 for full details).
Added method overloads for HaveNameStartingWith
, DoNotHaveNameStartingWith
, HaveNameEndingWith
, and DoNotHaveNameEndingWith
that accept a StringComparison
parameter.
Added new methods that allow you to specify lists of permissible dependencies: OnlyHaveDependenciesOn()
and HaveDependenciesOtherThan()
(#72)
Fixed an issue where the "IsPublic" test for internal classes was returning the wrong result (#74).
Thanks to @NeVeSpl and @RyanMarcotte for the pull requests.
v1.2.6
Custom rules can now be created and applied as predicates and conditions. A custom rule has to implement ICustomRule
and can be executed using a MeetCustomRule()
method (see the README and the sample project for examples).
Added HaveCustomAttributeOrInherit and NotHaveCustomAttributeOrInherit as predicates and conditions to test for inherited custom attributes (#55)
The following bugs have been fixed:
- ResideInNamespaceContaining now selects nested types (#59)
- Fixed issues with detecting dependencies in generics (#57 and #58)
- Fixed an issue where subclass detection was not taking the assembly into account properly (#52 and #56)
- Fixed an issue where types were being excluded if they were in a namespace with a System prefix (#36, #47 and #48)
v1.2.5
The dependency search logic has been re-written so it can scale for very large projects. It can now handle projects with thousands of modules and dependencies in a few seconds as opposed to a few hours.
A pattern matching bug has been fixed where false positives were being returned for both namespace and class names matching the input text.
Dependencies will now be found in a method's parameter list and a list of generic arguments.
Fixed an issue where the wrong types were being returned when the Or() method was used in conditions (#38).
A number of namespace matching methods have been added as predicates and conditions:
- ResideInNamespaceStartingWith
- ResideInNamespaceEndingWith
- ResideInNamespaceContaining
- DoNotResideInNamespaceStartingWith
- DoNotResideInNamespaceEndingWith
- DoNotResideInNamespaceContaining
Fixed the TypeDefinition.GetType() extension method so it will load managed C++ template instances.
Dependencies have been updated and test\sample projects brought up to .Net Core 3.1.
Many thanks to the contributors to this release: @AlexeyGorelenkov, @NeVeSpl and @vip32
v1.2.4
v1.2.3
v1.2.2
You can now distinguish between nested public and nested private classes. BeNestedPublic() and BeNestedPrivate() have been added as predicates and conditions. BeNested() will continue to select nested classes regardless of scope.
New dependency checking methods have been added that accept a list of dependencies. HaveDependencyOnAny() and HaveDependencyOnAll() are available as predictaes and conditions.
Dependency checking now splits instructions into individual tokens when searching.
v1.2.1
Accumulated bug fixes and minor changes:
- You can now specify optional search directories when loading Types using the Types.InAssembly or Types.InAssemblies methods
- Fixed a bug where rules were returning the wrong type list if a ShouldNot() condition was being used.
- Types that cannot be loaded by Mono.Cecil no longer throw a BadImageFormatException
- Fixed a typo in the "HasViolations" method - NB: this is a breaking change as it will require changes to existing implementations.