ArchUnitNET
ArchUnitNET copied to clipboard
Assemblies as a Syntax element
It would be nice to be able to write Rules like Assemblies().That().Rererence(...)
You can do that with types but then you can have the assembly reference and the test will not fail if no type is used.
private static bool IsInTestAssembly(IType type) => type.Assembly.Attributes.Any(a => a.Name == nameof(TestAssemblyAttribute));
private static IObjectProvider<IType> TypesResidingingInTestAssemblies = Types().That().FollowCustomPredicate(IsInTestAssembly, "Are in test assembly.");
Hi @DialLuesebrink , sounds like a good idea. Would you like to create a PR?
@DialLuesebrink, check out an alternative option to verify dependencies.
https://gaevoy.com/2022/05/19/review-dependencies-on-every-commit.html
@gaevoy this looks promising, how about integrating it into the ArchUnitNET
project?