diff --git a/ArchUnitNET/Fluent/Syntax/Elements/ObjectConditionsDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/ObjectConditionsDefinition.cs index 77a7219b..bec0fdcf 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/ObjectConditionsDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/ObjectConditionsDefinition.cs @@ -451,16 +451,18 @@ Architecture architecture .ToList(); foreach (var failedObject in ruleTypeList.Except(passedObjects)) { - var dynamicFailDescription = "does depend on"; - var first = true; - foreach (var type in failedObject.GetTypeDependencies().Except(typeList)) - { - dynamicFailDescription += first - ? " " + type.FullName - : " and " + type.FullName; - first = false; - } - + var actualTypeDependencies = failedObject + .GetTypeDependencies(architecture) + .Except(typeList); + var dynamicFailDescription = actualTypeDependencies.IsNullOrEmpty() + ? "does not depend on any type" + : actualTypeDependencies + .Where(type => !type.Equals(actualTypeDependencies.First())) + .Distinct() + .Aggregate( + "does depend on " + actualTypeDependencies.First().FullName, + (current, type) => current + " and " + type.FullName + ); yield return new ConditionResult(failedObject, false, dynamicFailDescription); } @@ -478,7 +480,10 @@ public static ICondition DependOnAny(IEnumerable types) { var typeList = types.ToList(); - IEnumerable Condition(IEnumerable ruleTypes) + IEnumerable Condition( + IEnumerable ruleTypes, + Architecture architecture + ) { var ruleTypeList = ruleTypes.ToList(); var passedObjects = ruleTypeList @@ -486,16 +491,18 @@ IEnumerable Condition(IEnumerable ruleTypes) .ToList(); foreach (var failedObject in ruleTypeList.Except(passedObjects)) { - var dynamicFailDescription = "does depend on"; - var first = true; - foreach (var type in failedObject.GetTypeDependencies().Except(typeList)) - { - dynamicFailDescription += first - ? " " + type.FullName - : " and " + type.FullName; - first = false; - } - + var actualTypeDependencies = failedObject + .GetTypeDependencies(architecture) + .Except(typeList); + var dynamicFailDescription = actualTypeDependencies.IsNullOrEmpty() + ? "does not depend on any type" + : actualTypeDependencies + .Where(type => !type.Equals(actualTypeDependencies.First())) + .Distinct() + .Aggregate( + "does depend on " + actualTypeDependencies.First().FullName, + (current, type) => current + " and " + type.FullName + ); yield return new ConditionResult(failedObject, false, dynamicFailDescription); } @@ -522,7 +529,7 @@ IEnumerable Condition(IEnumerable ruleTypes) ); } - return new EnumerableCondition(Condition, description); + return new ArchitectureCondition(Condition, description); } public static ICondition DependOnAny(IEnumerable types) @@ -554,18 +561,18 @@ Architecture architecture .ToList(); foreach (var failedObject in ruleTypeList.Except(passedObjects)) { - var dynamicFailDescription = "does depend on"; - var first = true; - foreach ( - var type in failedObject.GetTypeDependencies().Except(archUnitTypeList) - ) - { - dynamicFailDescription += first - ? " " + type.FullName - : " and " + type.FullName; - first = false; - } - + var actualTypeDependencies = failedObject + .GetTypeDependencies(architecture) + .Except(archUnitTypeList); + var dynamicFailDescription = actualTypeDependencies.IsNullOrEmpty() + ? "does not depend on any type" + : actualTypeDependencies + .Where(type => !type.Equals(actualTypeDependencies.First())) + .Distinct() + .Aggregate( + "does depend on " + actualTypeDependencies.First().FullName, + (current, type) => current + " and " + type.FullName + ); yield return new ConditionResult(failedObject, false, dynamicFailDescription); } @@ -617,11 +624,11 @@ public static ICondition OnlyDependOn( bool useRegularExpressions = false ) { - ConditionResult Condition(TRuleType ruleType) + ConditionResult Condition(TRuleType ruleType, Architecture architecture) { var pass = true; var dynamicFailDescription = "does depend on"; - foreach (var dependency in ruleType.GetTypeDependencies()) + foreach (var dependency in ruleType.GetTypeDependencies(architecture)) { if (!dependency.FullNameMatches(pattern, useRegularExpressions)) { @@ -635,7 +642,7 @@ ConditionResult Condition(TRuleType ruleType) return new ConditionResult(ruleType, pass, dynamicFailDescription); } - return new SimpleCondition( + return new ArchitectureCondition( Condition, "only depend on types with full name " + (useRegularExpressions ? "matching " : "") @@ -652,11 +659,11 @@ public static ICondition OnlyDependOn( { var patternList = patterns.ToList(); - ConditionResult Condition(TRuleType ruleType) + ConditionResult Condition(TRuleType ruleType, Architecture architecture) { var pass = true; var dynamicFailDescription = "does depend on"; - foreach (var dependency in ruleType.GetTypeDependencies()) + foreach (var dependency in ruleType.GetTypeDependencies(architecture)) { if ( !patternList.Any(pattern => @@ -695,7 +702,7 @@ ConditionResult Condition(TRuleType ruleType) ); } - return new SimpleCondition(Condition, description); + return new ArchitectureCondition(Condition, description); } public static ICondition OnlyDependOn(IType firstType, params IType[] moreTypes) @@ -728,7 +735,9 @@ Architecture architecture { var dynamicFailDescription = "does depend on"; var first = true; - foreach (var type in failedObject.GetTypeDependencies().Except(typeList)) + foreach ( + var type in failedObject.GetTypeDependencies(architecture).Except(typeList) + ) { dynamicFailDescription += first ? " " + type.FullName @@ -766,7 +775,9 @@ Architecture architecture { var dynamicFailDescription = "does depend on"; var first = true; - foreach (var type in failedObject.GetTypeDependencies().Except(typeList)) + foreach ( + var type in failedObject.GetTypeDependencies(architecture).Except(typeList) + ) { dynamicFailDescription += first ? " " + type.FullName @@ -837,7 +848,9 @@ Architecture architecture var dynamicFailDescription = "does depend on"; var first = true; foreach ( - var type in failedObject.GetTypeDependencies().Except(archUnitTypeList) + var type in failedObject + .GetTypeDependencies(architecture) + .Except(archUnitTypeList) ) { dynamicFailDescription += first diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectsShouldTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectsShouldTests.cs index 6b82179b..337fea65 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectsShouldTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectsShouldTests.cs @@ -635,11 +635,17 @@ public async Task DependOnAnyTest() .Should() .DependOnAny(helper.BaseClassWithMultipleDependenciesSystemType) .AssertNoViolations(helper); - Types() - .That() - .Are(helper.ChildClass, helper.BaseClass) - .Should() - .DependOnAny(helper.ClassWithoutDependencies) + should = Types().That().Are(helper.ChildClass, helper.BaseClass).Should(); + should.DependOnAny(helper.ClassWithoutDependencies.FullName).AssertOnlyViolations(helper); + should.DependOnAny([helper.ClassWithoutDependencies.FullName]).AssertOnlyViolations(helper); + should.DependOnAny(helper.ClassWithoutDependencies).AssertOnlyViolations(helper); + should.DependOnAny([helper.ClassWithoutDependencies]).AssertOnlyViolations(helper); + should.DependOnAny(helper.ClassWithoutDependenciesSystemType).AssertOnlyViolations(helper); + should + .DependOnAny([helper.ClassWithoutDependenciesSystemType]) + .AssertOnlyViolations(helper); + should + .DependOnAny(Classes().That().Are(helper.ClassWithoutDependencies)) .AssertOnlyViolations(helper); await helper.AssertSnapshotMatches(); } diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTest.verified.txt index c49509a6..bc9a91ba 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTest.verified.txt @@ -76,46 +76,46 @@ Message: Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on any Classes that are "TypeDependencyNamespace.ClassWithoutDependencies" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on any Classes that are "TypeDependencyNamespace.ClassWithoutDependencies"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -143,10 +143,10 @@ Message: Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "AttributeNamespace.ClassWithoutAttributes" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "AttributeNamespace.ClassWithoutAttributes"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -163,28 +163,28 @@ Message: Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on one of no types (impossible) Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on one of no types (impossible)" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on one of no types (impossible) Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on one of no types (impossible)" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on any Classes that have full name "NotTheNameOfAnyObject" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on any Classes that have full name "NotTheNameOfAnyObject"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -201,37 +201,37 @@ Message: Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that have full name "TypeDependencyNamespace.ClassWithMultipleDependencies" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" or "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -256,14 +256,86 @@ Description: TypeDependencyNamespace.ChildClass2 passed Message: All Evaluations passed +Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on any types with full name "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.BaseClass does not depend on any type with full name "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.ChildClass does not depend on any type with full name "TypeDependencyNamespace.ClassWithoutDependencies" +Message: +"Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on any types with full name "TypeDependencyNamespace.ClassWithoutDependencies"" failed: + TypeDependencyNamespace.BaseClass does not depend on any type with full name "TypeDependencyNamespace.ClassWithoutDependencies" + TypeDependencyNamespace.ChildClass does not depend on any type with full name "TypeDependencyNamespace.ClassWithoutDependencies" + + + +Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on any types with full name "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.BaseClass does not depend any types with full name "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.ChildClass does not depend any types with full name "TypeDependencyNamespace.ClassWithoutDependencies" +Message: +"Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on any types with full name "TypeDependencyNamespace.ClassWithoutDependencies"" failed: + TypeDependencyNamespace.BaseClass does not depend any types with full name "TypeDependencyNamespace.ClassWithoutDependencies" + TypeDependencyNamespace.ChildClass does not depend any types with full name "TypeDependencyNamespace.ClassWithoutDependencies" + + + +Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.BaseClass does not depend on any type +Result: False +Description: TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass +Message: +"Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: + TypeDependencyNamespace.BaseClass does not depend on any type + TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass + + + +Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.BaseClass does not depend on any type +Result: False +Description: TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass +Message: +"Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: + TypeDependencyNamespace.BaseClass does not depend on any type + TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass + + + Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" Result: False -Description: TypeDependencyNamespace.BaseClass does depend on System.Object +Description: TypeDependencyNamespace.BaseClass does not depend on any type Result: False Description: TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass Message: "Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: - TypeDependencyNamespace.BaseClass does depend on System.Object + TypeDependencyNamespace.BaseClass does not depend on any type + TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass + + + +Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.BaseClass does not depend on any type +Result: False +Description: TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass +Message: +"Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on "TypeDependencyNamespace.ClassWithoutDependencies"" failed: + TypeDependencyNamespace.BaseClass does not depend on any type + TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass + + + +Query: Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on any Classes that are "TypeDependencyNamespace.ClassWithoutDependencies" +Result: False +Description: TypeDependencyNamespace.BaseClass does not depend on any type +Result: False +Description: TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass +Message: +"Types that are "TypeDependencyNamespace.ChildClass" or "TypeDependencyNamespace.BaseClass" should depend on any Classes that are "TypeDependencyNamespace.ClassWithoutDependencies"" failed: + TypeDependencyNamespace.BaseClass does not depend on any type TypeDependencyNamespace.ChildClass does depend on TypeDependencyNamespace.BaseClass diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTypesThatTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTypesThatTest.verified.txt index 6ca2df93..4744b022 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTypesThatTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.DependOnAnyTypesThatTest.verified.txt @@ -10,10 +10,10 @@ All Evaluations passed Query: Types that are "TypeDependencyNamespace.BaseClass" should depend on any types that are "TypeDependencyNamespace.ChildClass" Result: False -Description: TypeDependencyNamespace.BaseClass does depend on System.Object +Description: TypeDependencyNamespace.BaseClass does not depend on any type Message: "Types that are "TypeDependencyNamespace.BaseClass" should depend on any types that are "TypeDependencyNamespace.ChildClass"" failed: - TypeDependencyNamespace.BaseClass does depend on System.Object + TypeDependencyNamespace.BaseClass does not depend on any type diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTest.verified.txt index 2c7252ac..aac91351 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTest.verified.txt @@ -58,64 +58,64 @@ All Evaluations passed Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on Classes that are "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on Classes that are "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -123,19 +123,19 @@ Message: Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "NotTheNameOfAnyObject" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "NotTheNameOfAnyObject"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "NotTheNameOfAnyObject" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "NotTheNameOfAnyObject"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -143,10 +143,10 @@ Message: Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "AttributeNamespace.ClassWithoutAttributes" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "AttributeNamespace.ClassWithoutAttributes"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -154,37 +154,37 @@ Message: Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should have no dependencies Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should have no dependencies" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass and System.Object + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should have no dependencies Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should have no dependencies" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should have no dependencies Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should have no dependencies" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on Classes that have full name "NotTheNameOfAnyObject" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on Classes that have full name "NotTheNameOfAnyObject"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass @@ -192,55 +192,55 @@ Message: Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and System.Object +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types with full name "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and System.Object + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on Classes that are "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on Classes that are "TypeDependencyNamespace.BaseClass" or "TypeDependencyNamespace.OtherBaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTypesThatTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTypesThatTest.verified.txt index 3ad0159b..58ddf428 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTypesThatTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectsShouldTests.OnlyDependOnTypesThatTest.verified.txt @@ -10,10 +10,10 @@ All Evaluations passed Query: Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types that have full name "TypeDependencyNamespace.BaseClass" Result: False -Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass +Description: TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass Message: "Types that are "TypeDependencyNamespace.ClassWithMultipleDependencies" should only depend on types that have full name "TypeDependencyNamespace.BaseClass"" failed: - TypeDependencyNamespace.ClassWithMultipleDependencies does depend on System.Object and System.Runtime.CompilerServices.NullableContextAttribute and System.Runtime.CompilerServices.NullableAttribute and TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass + TypeDependencyNamespace.ClassWithMultipleDependencies does depend on TypeDependencyNamespace.BaseClassWithMember and TypeDependencyNamespace.OtherBaseClass