From ecbe09fc062ac9f5c3dfd677f1361cdf7d7c9bb6 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Sat, 21 Mar 2026 00:10:59 +0100 Subject: [PATCH 1/6] test: rewrite method member syntax elements tests Signed-off-by: Alexander Linne --- .../MethodDependencyAssemblyTestHelper.cs | 24 + .../TypeAssemblyTestHelper.cs | 76 ++ .../MethodMemberSyntaxElementsTests.cs | 984 ++++++++++-------- ...xElementsTests.BeCalledByTest.verified.txt | 285 +++++ ...ementsTests.BeConstructorTest.verified.txt | 63 ++ ...Tests.BeMethodMembersThatTest.verified.txt | 19 + ...entsTests.BeNoConstructorTest.verified.txt | 63 ++ ...axElementsTests.BeVirtualTest.verified.txt | 63 ++ ...Tests.DoNotHaveReturnTypeTest.verified.txt | 247 +++++ ...eDependencyInMethodBodyToTest.verified.txt | 285 +++++ ...mentsTests.HaveReturnTypeTest.verified.txt | 237 +++++ ...ementsTests.NotBeCalledByTest.verified.txt | 273 +++++ ...lementsTests.NotBeVirtualTest.verified.txt | 63 ++ ...eDependencyInMethodBodyToTest.verified.txt | 273 +++++ .../MethodDependency.cs | 15 + TestAssemblies/TypeAssembly/Type.cs | 48 + 16 files changed, 2593 insertions(+), 425 deletions(-) create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt diff --git a/ArchUnitNETTests/AssemblyTestHelper/MethodDependencyAssemblyTestHelper.cs b/ArchUnitNETTests/AssemblyTestHelper/MethodDependencyAssemblyTestHelper.cs index 99a5a9eae..368e88bed 100644 --- a/ArchUnitNETTests/AssemblyTestHelper/MethodDependencyAssemblyTestHelper.cs +++ b/ArchUnitNETTests/AssemblyTestHelper/MethodDependencyAssemblyTestHelper.cs @@ -9,6 +9,14 @@ public class MethodDependencyAssemblyTestHelper : AssemblyTestHelper public sealed override Architecture Architecture => StaticTestArchitectures.MethodDependencyArchitecture; + public Class MethodDependencyClass; + public System.Type MethodDependencyClassSystemType = + typeof(MethodDependencyNamespace.MethodDependencyClass); + + public Class OtherCallingClass; + public System.Type OtherCallingClassSystemType = + typeof(MethodDependencyNamespace.OtherCallingClass); + public MethodMember MethodWithSingleDependency; public MethodMember CalledMethod; @@ -23,8 +31,18 @@ public class MethodDependencyAssemblyTestHelper : AssemblyTestHelper public MethodMember MethodWithoutDependencies; + public MethodMember MethodCallingCalledMethod; + + public MethodMember AnotherMethodCallingCalledMethod; + public MethodDependencyAssemblyTestHelper() { + MethodDependencyClass = Architecture.GetClassOfType( + typeof(MethodDependencyNamespace.MethodDependencyClass) + ); + OtherCallingClass = Architecture.GetClassOfType( + typeof(MethodDependencyNamespace.OtherCallingClass) + ); MethodWithSingleDependency = Architecture .MethodMembers.WhereNameIs("MethodWithSingleDependency()") .First(); @@ -38,5 +56,11 @@ public MethodDependencyAssemblyTestHelper() MethodWithoutDependencies = Architecture .MethodMembers.WhereNameIs("MethodWithoutDependencies()") .First(); + MethodCallingCalledMethod = Architecture + .MethodMembers.WhereNameIs("MethodCallingCalledMethod()") + .First(); + AnotherMethodCallingCalledMethod = Architecture + .MethodMembers.WhereNameIs("AnotherMethodCallingCalledMethod()") + .First(); } } diff --git a/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs b/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs index 5576ed067..c65e2e497 100644 --- a/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs +++ b/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs @@ -142,6 +142,29 @@ public class TypeAssemblyTestHelper : AssemblyTestHelper public Class ClassWithStaticMethod; public Type ClassWithStaticMethodSystemType = typeof(ClassWithStaticMethod); + // Method member test classes + public Class ClassWithVirtualMethod; + public Type ClassWithVirtualMethodSystemType = typeof(ClassWithVirtualMethod); + + public Class OtherClassWithVirtualMethod; + public Type OtherClassWithVirtualMethodSystemType = typeof(OtherClassWithVirtualMethod); + + public Class ClassWithNonVirtualMethod; + public Type ClassWithNonVirtualMethodSystemType = typeof(ClassWithNonVirtualMethod); + + public Class ClassWithStringReturnType; + public Type ClassWithStringReturnTypeSystemType = typeof(ClassWithStringReturnType); + + public Class ClassWithIntReturnType; + public Type ClassWithIntReturnTypeSystemType = typeof(ClassWithIntReturnType); + + public Class ClassWithRegularClassReturnType; + public Type ClassWithRegularClassReturnTypeSystemType = typeof(ClassWithRegularClassReturnType); + + public Class ClassWithOtherRegularClassReturnType; + public Type ClassWithOtherRegularClassReturnTypeSystemType = + typeof(ClassWithOtherRegularClassReturnType); + // Individual members public IMember StaticField; public IMember NonStaticField; @@ -154,6 +177,17 @@ public class TypeAssemblyTestHelper : AssemblyTestHelper public IMember StaticProperty; public IMember StaticMethod; + // Method members (MethodMember type) + public MethodMember VirtualMethod; + public MethodMember OtherVirtualMethod; + public MethodMember NonVirtualMethod; + public MethodMember MethodReturningString; + public MethodMember MethodReturningInt; + public MethodMember ClassWithVirtualMethodConstructor; + public MethodMember ClassWithNonVirtualMethodConstructor; + public MethodMember MethodReturningRegularClass; + public MethodMember MethodReturningOtherRegularClass; + public TypeAssemblyTestHelper() { SimpleEnum = Architecture.GetITypeOfType(typeof(SimpleEnum)); @@ -241,5 +275,47 @@ public TypeAssemblyTestHelper() .GetPropertyMembersWithName("StaticProperty") .First(); StaticMethod = ClassWithStaticMethod.GetMethodMembersWithName("StaticMethod()").First(); + + // Method member test classes + ClassWithVirtualMethod = Architecture.GetClassOfType(typeof(ClassWithVirtualMethod)); + OtherClassWithVirtualMethod = Architecture.GetClassOfType( + typeof(OtherClassWithVirtualMethod) + ); + ClassWithNonVirtualMethod = Architecture.GetClassOfType(typeof(ClassWithNonVirtualMethod)); + ClassWithStringReturnType = Architecture.GetClassOfType(typeof(ClassWithStringReturnType)); + ClassWithIntReturnType = Architecture.GetClassOfType(typeof(ClassWithIntReturnType)); + ClassWithRegularClassReturnType = Architecture.GetClassOfType( + typeof(ClassWithRegularClassReturnType) + ); + ClassWithOtherRegularClassReturnType = Architecture.GetClassOfType( + typeof(ClassWithOtherRegularClassReturnType) + ); + + // Method members (MethodMember type) + VirtualMethod = ClassWithVirtualMethod.GetMethodMembersWithName("VirtualMethod()").First(); + OtherVirtualMethod = OtherClassWithVirtualMethod + .GetMethodMembersWithName("OtherVirtualMethod()") + .First(); + NonVirtualMethod = ClassWithNonVirtualMethod + .GetMethodMembersWithName("NonVirtualMethod()") + .First(); + MethodReturningString = ClassWithStringReturnType + .GetMethodMembersWithName("MethodReturningString()") + .First(); + MethodReturningInt = ClassWithIntReturnType + .GetMethodMembersWithName("MethodReturningInt()") + .First(); + ClassWithVirtualMethodConstructor = ClassWithVirtualMethod + .GetMethodMembersWithName(".ctor()") + .First(); + ClassWithNonVirtualMethodConstructor = ClassWithNonVirtualMethod + .GetMethodMembersWithName(".ctor()") + .First(); + MethodReturningRegularClass = ClassWithRegularClassReturnType + .GetMethodMembersWithName("MethodReturningRegularClass()") + .First(); + MethodReturningOtherRegularClass = ClassWithOtherRegularClassReturnType + .GetMethodMembersWithName("MethodReturningOtherRegularClass()") + .First(); } } diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs index ba31a1b45..05372ba90 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs @@ -1,472 +1,606 @@ -using System.Collections.Generic; -using System.Linq; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using ArchUnitNET.Domain; -using ArchUnitNET.Domain.Extensions; -using ArchUnitNETTests.Domain; +using ArchUnitNETTests.AssemblyTestHelper; using Xunit; using static ArchUnitNET.Fluent.ArchRuleDefinition; namespace ArchUnitNETTests.Fluent.Syntax.Elements { + // csharpier-ignore public class MethodMemberSyntaxElementsTests { - private static readonly Architecture Architecture = - StaticTestArchitectures.ArchUnitNETTestArchitecture; - private readonly IEnumerable _methodMembers; - private readonly IEnumerable _types; - - public MethodMemberSyntaxElementsTests() + [Fact] + public async Task BeConstructorTest() { - _methodMembers = Architecture.MethodMembers; - _types = Architecture.Types; + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeConstructor().AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreConstructors()).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.VirtualMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeConstructor().AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreConstructors()).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor, helper.ClassWithNonVirtualMethodConstructor).Should().BeConstructor().AssertNoViolations(helper); + MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor, helper.VirtualMethod).Should().BeConstructor().AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void AreConstructorsTest() + public async Task BeNoConstructorTest() { - foreach (var methodMember in _methodMembers) - { - var methodMemberIsConstructor = MethodMembers() - .That() - .Are(methodMember) - .Should() - .BeConstructor(); - var methodMemberIsNoConstructor = MethodMembers() - .That() - .Are(methodMember) - .Should() - .BeNoConstructor(); - var constructorMethodMembersDoNotIncludeMember = MethodMembers() - .That() - .AreConstructors() - .Should() - .NotBe(methodMember) - .OrShould() - .NotExist(); - var noConstructorMethodMembersDoNotIncludeMember = MethodMembers() - .That() - .AreNoConstructors() - .Should() - .NotBe(methodMember) - .AndShould() - .Exist(); - - Assert.Equal( - methodMember.IsConstructor(), - methodMemberIsConstructor.HasNoViolations(Architecture) - ); - Assert.Equal( - !methodMember.IsConstructor(), - methodMemberIsNoConstructor.HasNoViolations(Architecture) - ); - Assert.Equal( - !methodMember.IsConstructor(), - constructorMethodMembersDoNotIncludeMember.HasNoViolations(Architecture) - ); - Assert.Equal( - methodMember.IsConstructor(), - noConstructorMethodMembersDoNotIncludeMember.HasNoViolations(Architecture) - ); - } - - var constructorMethodMembersShouldBeConstructor = MethodMembers() - .That() - .AreConstructors() - .Should() - .BeConstructor(); - var constructorMethodMembersAreNoConstructors = MethodMembers() - .That() - .AreConstructors() - .Should() - .BeNoConstructor() - .AndShould() - .Exist(); - var noConstructorMethodMembersShouldBeConstructor = MethodMembers() - .That() - .AreNoConstructors() - .Should() - .BeConstructor() - .AndShould() - .Exist(); - var noConstructorMethodMembersAreNoConstructors = MethodMembers() - .That() - .AreNoConstructors() - .Should() - .BeNoConstructor(); - - Assert.True(constructorMethodMembersShouldBeConstructor.HasNoViolations(Architecture)); - Assert.False(constructorMethodMembersAreNoConstructors.HasNoViolations(Architecture)); - Assert.False( - noConstructorMethodMembersShouldBeConstructor.HasNoViolations(Architecture) - ); - Assert.True(noConstructorMethodMembersAreNoConstructors.HasNoViolations(Architecture)); + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.VirtualMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeNoConstructor().AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNoConstructors()).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeNoConstructor().AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNoConstructors()).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.VirtualMethod, helper.NonVirtualMethod).Should().BeNoConstructor().AssertNoViolations(helper); + MethodMembers().That().Are(helper.VirtualMethod, helper.ClassWithVirtualMethodConstructor).Should().BeNoConstructor().AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void AreVirtualTest() + public async Task BeVirtualTest() { - foreach (var methodMember in _methodMembers) - { - var methodMemberIsVirtual = MethodMembers() - .That() - .Are(methodMember) - .Should() - .BeVirtual(); - var methodMemberIsNotVirtual = MethodMembers() - .That() - .Are(methodMember) - .Should() - .NotBeVirtual(); - var virtualMethodMembersDoNotIncludeMember = MethodMembers() - .That() - .AreVirtual() - .Should() - .NotBe(methodMember) - .OrShould() - .NotExist(); - var notVirtualMethodMembersDoNotIncludeMember = MethodMembers() - .That() - .AreNotVirtual() - .Should() - .NotBe(methodMember) - .AndShould() - .Exist(); - - Assert.Equal( - methodMember.IsVirtual, - methodMemberIsVirtual.HasNoViolations(Architecture) - ); - Assert.Equal( - !methodMember.IsVirtual, - methodMemberIsNotVirtual.HasNoViolations(Architecture) - ); - Assert.Equal( - !methodMember.IsVirtual, - virtualMethodMembersDoNotIncludeMember.HasNoViolations(Architecture) - ); - Assert.Equal( - methodMember.IsVirtual, - notVirtualMethodMembersDoNotIncludeMember.HasNoViolations(Architecture) - ); - } - - var virtualMethodMembersShouldBeVirtual = MethodMembers() - .That() - .AreVirtual() - .Should() - .BeVirtual() - .WithoutRequiringPositiveResults(); - var virtualMethodMembersAreNotVirtual = MethodMembers() - .That() - .AreVirtual() - .Should() - .NotBeVirtual() - .AndShould() - .Exist(); - var notVirtualMethodMembersShouldBeVirtual = MethodMembers() - .That() - .AreNotVirtual() - .Should() - .BeVirtual() - .AndShould() - .Exist(); - var notVirtualMethodMembersAreNotVirtual = MethodMembers() - .That() - .AreNotVirtual() - .Should() - .NotBeVirtual(); - - Assert.True(virtualMethodMembersShouldBeVirtual.HasNoViolations(Architecture)); - Assert.False(virtualMethodMembersAreNotVirtual.HasNoViolations(Architecture)); - Assert.False(notVirtualMethodMembersShouldBeVirtual.HasNoViolations(Architecture)); - Assert.True(notVirtualMethodMembersAreNotVirtual.HasNoViolations(Architecture)); + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.VirtualMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeVirtual().AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreVirtual()).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.NonVirtualMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeVirtual().AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreVirtual()).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.VirtualMethod, helper.OtherVirtualMethod).Should().BeVirtual().AssertNoViolations(helper); + MethodMembers().That().Are(helper.VirtualMethod, helper.NonVirtualMethod).Should().BeVirtual().AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void CalledByTest() + public async Task NotBeVirtualTest() { - foreach (var methodMember in _methodMembers) - { - foreach ( - var callingType in methodMember - .GetMethodCallDependencies(true) - .Select(dependency => dependency.Origin) - ) - { - var methodIsCalledByRightType = MethodMembers() - .That() - .Are(methodMember) - .Should() - .BeCalledBy(callingType); - var methodIsNotCalledByRightType = MethodMembers() - .That() - .Are(methodMember) - .Should() - .NotBeCalledBy(callingType); - - Assert.True(methodIsCalledByRightType.HasNoViolations(Architecture)); - Assert.False(methodIsNotCalledByRightType.HasNoViolations(Architecture)); - } - - var methodIsCalledByFalseType = MethodMembers() - .That() - .Are(methodMember) - .Should() - .BeCalledBy(typeof(PublicTestClass)); - var methodIsNotCalledByFalseType = MethodMembers() - .That() - .Are(methodMember) - .Should() - .NotBeCalledBy(typeof(PublicTestClass)); - - Assert.False(methodIsCalledByFalseType.HasNoViolations(Architecture)); - Assert.True(methodIsNotCalledByFalseType.HasNoViolations(Architecture)); - } - - foreach (var type in _types) - { - var calledMethodsShouldBeCalled = MethodMembers() - .That() - .AreCalledBy(type) - .Should() - .BeCalledBy(type) - .WithoutRequiringPositiveResults(); - var notCalledMethodsShouldNotBeCalled = MethodMembers() - .That() - .AreNotCalledBy(type) - .Should() - .NotBeCalledBy(type); - - Assert.True(calledMethodsShouldBeCalled.HasNoViolations(Architecture)); - Assert.True(notCalledMethodsShouldNotBeCalled.HasNoViolations(Architecture)); - } - - var emptyTypeCallsNoMethods = MethodMembers() - .That() - .AreCalledBy(typeof(PublicTestClass)) - .Should() - .NotExist(); - var methodsNotCalledByEmptyTypeShouldExist = MethodMembers() - .That() - .AreNotCalledBy(typeof(PublicTestClass)) - .Should() - .Exist(); - - Assert.True(emptyTypeCallsNoMethods.HasNoViolations(Architecture)); - Assert.True(methodsNotCalledByEmptyTypeShouldExist.HasNoViolations(Architecture)); + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.NonVirtualMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotBeVirtual().AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotVirtual()).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.VirtualMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotBeVirtual().AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotVirtual()).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.NonVirtualMethod, helper.MethodReturningString).Should().NotBeVirtual().AssertNoViolations(helper); + MethodMembers().That().Are(helper.NonVirtualMethod, helper.VirtualMethod).Should().NotBeVirtual().AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void HaveDependencyInMethodBodyTest() + public async Task BeCalledByTest() { - foreach (var methodMember in _methodMembers) - { - foreach ( - var dependency in methodMember - .GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - ) - { - var hasRightDependency = MethodMembers() - .That() - .Are(methodMember) - .Should() - .HaveDependencyInMethodBodyTo(dependency); - var doesNotHaveRightDependency = MethodMembers() - .That() - .Are(methodMember) - .Should() - .NotHaveDependencyInMethodBodyTo(dependency); - - Assert.True(hasRightDependency.HasNoViolations(Architecture)); - Assert.False(doesNotHaveRightDependency.HasNoViolations(Architecture)); - } - } - - foreach (var type in _types) - { - var dependentMethodsShouldBeDependent = MethodMembers() - .That() - .HaveDependencyInMethodBodyTo(type) - .Should() - .HaveDependencyInMethodBodyTo(type) - .WithoutRequiringPositiveResults(); - var notDependentMethodsShouldNotBeDependent = MethodMembers() - .That() - .DoNotHaveDependencyInMethodBodyTo(type) - .Should() - .NotHaveDependencyInMethodBodyTo(type); - - Assert.True(dependentMethodsShouldBeDependent.HasNoViolations(Architecture)); - Assert.True(notDependentMethodsShouldNotBeDependent.HasNoViolations(Architecture)); - } + var helper = new MethodDependencyAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); + should.BeCalledBy(helper.MethodDependencyClassSystemType).AssertNoViolations(helper); + should.BeCalledBy(Types().That().Are(helper.MethodDependencyClass)).AssertNoViolations(helper); + should.BeCalledBy(new List { helper.MethodDependencyClass }).AssertNoViolations(helper); + should.BeCalledBy(new List { helper.MethodDependencyClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreCalledBy(helper.MethodDependencyClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(helper.MethodDependencyClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(Types().That().Are(helper.MethodDependencyClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { helper.MethodDependencyClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { helper.MethodDependencyClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeCalledBy(helper.MethodDependencyClass).AssertOnlyViolations(helper); + should.BeCalledBy(helper.MethodDependencyClassSystemType).AssertOnlyViolations(helper); + should.BeCalledBy(Types().That().Are(helper.MethodDependencyClass)).AssertOnlyViolations(helper); + should.BeCalledBy(new List { helper.MethodDependencyClass }).AssertOnlyViolations(helper); + should.BeCalledBy(new List { helper.MethodDependencyClassSystemType }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreCalledBy(helper.MethodDependencyClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(helper.MethodDependencyClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(Types().That().Are(helper.MethodDependencyClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { helper.MethodDependencyClass })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { helper.MethodDependencyClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple arguments"); + should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeCalledBy(helper.MethodDependencyClass, helper.OtherCallingClass).AssertNoViolations(helper); + should.BeCalledBy(new List { helper.MethodDependencyClass, helper.OtherCallingClass }).AssertNoViolations(helper); + should.BeCalledBy(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType).AssertNoViolations(helper); + should.BeCalledBy(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreCalledBy(helper.MethodDependencyClass, helper.OtherCallingClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { helper.MethodDependencyClass, helper.OtherCallingClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Empty arguments"); + should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + // TODO: Empty IEnumerable/ crashes with InvalidOperationException + // (.First() on empty list) — uncomment when AssertException supports lazy evaluation + // should.BeCalledBy(new List()).AssertException(helper); + // should.BeCalledBy(new List()).AssertException(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreCalledBy(new List())).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List())).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Type not in architecture"); + should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.CalledMethod, helper.CalledMethod1).Should().BeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); + MethodMembers().That().Are(helper.CalledMethod, helper.MethodWithoutDependencies).Should().BeCalledBy(helper.MethodDependencyClass).AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void HaveReturnTypeConditionTest() + public async Task NotBeCalledByTest() { - var retTypeWithType = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .Should() - .HaveReturnType(typeof(ReturnTypeClass), typeof(void), typeof(string)); - var retTypeWithTypeFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .Should() - .HaveReturnType(typeof(bool)); - - Assert.True(retTypeWithType.HasNoViolations(Architecture)); - Assert.False(retTypeWithTypeFail.HasNoViolations(Architecture)); - - var objectProviderClass = Classes().That().HaveFullNameContaining("ReturnTypeClass"); - var retTypeWithObjectProvider = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodClass") - .Should() - .HaveReturnType(objectProviderClass); - var retTypeWithObjectProviderFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodVoid") - .Should() - .HaveReturnType(objectProviderClass); - - Assert.True(retTypeWithObjectProvider.HasNoViolations(Architecture)); - Assert.False(retTypeWithObjectProviderFail.HasNoViolations(Architecture)); - - var retTypeWithIType = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodClass") - .Should() - .HaveReturnType(objectProviderClass.GetObjects(Architecture).ToList().First()); - var retTypeWithITypeFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodString") - .Should() - .HaveReturnType(objectProviderClass.GetObjects(Architecture).ToList().First()); - - Assert.True(retTypeWithIType.HasNoViolations(Architecture)); - Assert.False(retTypeWithITypeFail.HasNoViolations(Architecture)); + var helper = new MethodDependencyAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotBeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); + should.NotBeCalledBy(helper.MethodDependencyClassSystemType).AssertNoViolations(helper); + should.NotBeCalledBy(Types().That().Are(helper.MethodDependencyClass)).AssertNoViolations(helper); + should.NotBeCalledBy(new List { helper.MethodDependencyClass }).AssertNoViolations(helper); + should.NotBeCalledBy(new List { helper.MethodDependencyClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotCalledBy(helper.MethodDependencyClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(helper.MethodDependencyClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(Types().That().Are(helper.MethodDependencyClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { helper.MethodDependencyClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { helper.MethodDependencyClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotBeCalledBy(helper.MethodDependencyClass).AssertOnlyViolations(helper); + should.NotBeCalledBy(helper.MethodDependencyClassSystemType).AssertOnlyViolations(helper); + should.NotBeCalledBy(Types().That().Are(helper.MethodDependencyClass)).AssertOnlyViolations(helper); + should.NotBeCalledBy(new List { helper.MethodDependencyClass }).AssertOnlyViolations(helper); + should.NotBeCalledBy(new List { helper.MethodDependencyClassSystemType }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotCalledBy(helper.MethodDependencyClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(helper.MethodDependencyClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(Types().That().Are(helper.MethodDependencyClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { helper.MethodDependencyClass })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { helper.MethodDependencyClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple arguments"); + should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotBeCalledBy(helper.MethodDependencyClass, helper.OtherCallingClass).AssertNoViolations(helper); + should.NotBeCalledBy(new List { helper.MethodDependencyClass, helper.OtherCallingClass }).AssertNoViolations(helper); + should.NotBeCalledBy(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType).AssertNoViolations(helper); + should.NotBeCalledBy(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotCalledBy(helper.MethodDependencyClass, helper.OtherCallingClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { helper.MethodDependencyClass, helper.OtherCallingClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Empty arguments"); + should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + // TODO: Empty IEnumerable/ crashes with InvalidOperationException + // (.First() on empty list) — uncomment when AssertException supports lazy evaluation + // should.NotBeCalledBy(new List()).AssertException(helper); + // should.NotBeCalledBy(new List()).AssertException(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotCalledBy(new List())).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List())).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Type not in architecture"); + should = MethodMembers().That().Are(helper.CalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotBeCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().AreNotCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.MethodWithoutDependencies, helper.MethodCallingCalledMethod).Should().NotBeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); + MethodMembers().That().Are(helper.CalledMethod, helper.MethodWithoutDependencies).Should().NotBeCalledBy(helper.MethodDependencyClass).AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void NotHaveReturnTypeConditionTest() + public async Task HaveDependencyInMethodBodyToTest() { - var retTypeWithType = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .Should() - .NotHaveReturnType(typeof(bool)); - var retTypeWithTypeFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .Should() - .NotHaveReturnType(typeof(ReturnTypeClass), typeof(void), typeof(string)); - - Assert.True(retTypeWithType.HasNoViolations(Architecture)); - Assert.False(retTypeWithTypeFail.HasNoViolations(Architecture)); - - var objectProviderClass = Classes().That().HaveFullNameContaining("ReturnTypeClass"); - var retTypeWithObjectProvider = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodVoid") - .Should() - .NotHaveReturnType(objectProviderClass); - var retTypeWithObjectProviderFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodClass") - .Should() - .NotHaveReturnType(objectProviderClass); - - Assert.True(retTypeWithObjectProvider.HasNoViolations(Architecture)); - Assert.False(retTypeWithObjectProviderFail.HasNoViolations(Architecture)); - - var retTypeWithIType = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodString") - .Should() - .NotHaveReturnType(objectProviderClass.GetObjects(Architecture).ToList().First()); - var retTypeWithITypeFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethodClass") - .Should() - .NotHaveReturnType(objectProviderClass.GetObjects(Architecture).ToList().First()); - - Assert.True(retTypeWithIType.HasNoViolations(Architecture)); - Assert.False(retTypeWithITypeFail.HasNoViolations(Architecture)); + var helper = new MethodDependencyAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveDependencyInMethodBodyTo(helper.MethodDependencyClass).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(Types().That().Are(helper.MethodDependencyClass)).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass }).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(helper.MethodDependencyClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(Types().That().Are(helper.MethodDependencyClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveDependencyInMethodBodyTo(helper.OtherCallingClass).AssertOnlyViolations(helper); + should.HaveDependencyInMethodBodyTo(helper.OtherCallingClassSystemType).AssertOnlyViolations(helper); + should.HaveDependencyInMethodBodyTo(Types().That().Are(helper.OtherCallingClass)).AssertOnlyViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { helper.OtherCallingClass }).AssertOnlyViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { helper.OtherCallingClassSystemType }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(helper.OtherCallingClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(helper.OtherCallingClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(Types().That().Are(helper.OtherCallingClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { helper.OtherCallingClass })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { helper.OtherCallingClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple arguments"); + should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveDependencyInMethodBodyTo(helper.MethodDependencyClass, helper.OtherCallingClass).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass, helper.OtherCallingClass }).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType).AssertNoViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(helper.MethodDependencyClass, helper.OtherCallingClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass, helper.OtherCallingClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Empty arguments"); + should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + // TODO: Empty IEnumerable/ crashes with InvalidOperationException + // (.First() on empty list) — uncomment when AssertException supports lazy evaluation + // should.HaveDependencyInMethodBodyTo(new List()).AssertException(helper); + // should.HaveDependencyInMethodBodyTo(new List()).AssertException(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List())).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List())).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Type not in architecture"); + should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.MethodCallingCalledMethod, helper.AnotherMethodCallingCalledMethod).Should().HaveDependencyInMethodBodyTo(helper.MethodDependencyClass).AssertNoViolations(helper); + MethodMembers().That().Are(helper.MethodCallingCalledMethod, helper.MethodWithoutDependencies).Should().HaveDependencyInMethodBodyTo(helper.MethodDependencyClass).AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } [Fact] - public void HaveReturnTypePredicateTest() + public async Task NotHaveDependencyInMethodBodyToTest() { - var retTypeWithType = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .And() - .HaveReturnType(typeof(ReturnTypeClass)) - .Should() - .HaveFullNameContaining("Class"); - var retTypeWithTypeFail = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .And() - .DoNotHaveReturnType(typeof(ReturnTypeClass)) - .Should() - .HaveNameContaining("Class"); - - Assert.True(retTypeWithType.HasNoViolations(Architecture)); - Assert.False(retTypeWithTypeFail.HasNoViolations(Architecture)); - - var objectProviderClass = Classes().That().HaveFullNameContaining("ReturnTypeClass"); - var retTypeWithObjectProvider = MethodMembers() - .That() - .HaveReturnType(objectProviderClass) - .Should() - .HaveFullNameContaining("ReturnTypeMethodClass"); - var retTypeWithObjectProviderFail = MethodMembers() - .That() - .DoNotHaveReturnType(objectProviderClass) - .And() - .HaveFullNameContaining("ReturnTypeMethod") - .Should() - .HaveFullNameContaining("ReturnTypeMethodClass"); - - Assert.True(retTypeWithObjectProvider.HasNoViolations(Architecture)); - Assert.False(retTypeWithObjectProviderFail.HasNoViolations(Architecture)); - - var retTypeWithITypeFail = MethodMembers() - .That() - .HaveReturnType(objectProviderClass.GetObjects(Architecture).ToList().First()) - .Should() - .HaveFullNameContaining("ReturnTypeMethodVoid"); - - var retTypeWithITypeNegate = MethodMembers() - .That() - .HaveFullNameContaining("ReturnTypeMethod") - .And() - .DoNotHaveReturnType(objectProviderClass.GetObjects(Architecture).ToList().First()) - .Should() - .HaveFullNameContaining("String") - .OrShould() - .HaveFullNameContaining("Void"); - - Assert.False(retTypeWithITypeFail.HasNoViolations(Architecture)); - Assert.True(retTypeWithITypeNegate.HasNoViolations(Architecture)); + var helper = new MethodDependencyAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveDependencyInMethodBodyTo(helper.OtherCallingClass).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(helper.OtherCallingClassSystemType).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(Types().That().Are(helper.OtherCallingClass)).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { helper.OtherCallingClass }).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { helper.OtherCallingClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(helper.OtherCallingClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(helper.OtherCallingClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(Types().That().Are(helper.OtherCallingClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { helper.OtherCallingClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { helper.OtherCallingClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveDependencyInMethodBodyTo(helper.MethodDependencyClass).AssertOnlyViolations(helper); + should.NotHaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType).AssertOnlyViolations(helper); + should.NotHaveDependencyInMethodBodyTo(Types().That().Are(helper.MethodDependencyClass)).AssertOnlyViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass }).AssertOnlyViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(helper.MethodDependencyClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(Types().That().Are(helper.MethodDependencyClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple arguments"); + should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveDependencyInMethodBodyTo(helper.MethodDependencyClass, helper.OtherCallingClass).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass, helper.OtherCallingClass }).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(helper.MethodDependencyClass, helper.OtherCallingClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClass, helper.OtherCallingClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { helper.MethodDependencyClassSystemType, helper.OtherCallingClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Empty arguments"); + should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + // TODO: Empty IEnumerable/ crashes with InvalidOperationException + // (.First() on empty list) — uncomment when AssertException supports lazy evaluation + // should.NotHaveDependencyInMethodBodyTo(new List()).AssertException(helper); + // should.NotHaveDependencyInMethodBodyTo(new List()).AssertException(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List())).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List())).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Type not in architecture"); + should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.MethodWithoutDependencies, helper.CalledMethod).Should().NotHaveDependencyInMethodBodyTo(helper.OtherCallingClass).AssertNoViolations(helper); + MethodMembers().That().Are(helper.MethodCallingCalledMethod, helper.MethodWithoutDependencies).Should().NotHaveDependencyInMethodBodyTo(helper.MethodDependencyClass).AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } - } - internal class ReturnTypeClass - { - public void ReturnTypeMethodVoid() { } + [Fact] + public async Task HaveReturnTypeTest() + { + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(helper.RegularClass).AssertNoViolations(helper); + should.HaveReturnType(helper.RegularClassSystemType).AssertNoViolations(helper); + should.HaveReturnType(Types().That().Are(helper.RegularClass)).AssertNoViolations(helper); + should.HaveReturnType(new List { helper.RegularClass }).AssertNoViolations(helper); + should.HaveReturnType(new List { helper.RegularClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(helper.RegularClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(helper.RegularClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(Types().That().Are(helper.RegularClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { helper.RegularClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { helper.RegularClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(helper.OtherRegularClass).AssertOnlyViolations(helper); + should.HaveReturnType(helper.OtherRegularClassSystemType).AssertOnlyViolations(helper); + should.HaveReturnType(Types().That().Are(helper.OtherRegularClass)).AssertOnlyViolations(helper); + should.HaveReturnType(new List { helper.OtherRegularClass }).AssertOnlyViolations(helper); + should.HaveReturnType(new List { helper.OtherRegularClassSystemType }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(helper.OtherRegularClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(helper.OtherRegularClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(Types().That().Are(helper.OtherRegularClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { helper.OtherRegularClass })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { helper.OtherRegularClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple arguments"); + should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(helper.RegularClass, helper.OtherRegularClass).AssertNoViolations(helper); + should.HaveReturnType(new List { helper.RegularClass, helper.OtherRegularClass }).AssertNoViolations(helper); + should.HaveReturnType(helper.RegularClassSystemType, helper.OtherRegularClassSystemType).AssertNoViolations(helper); + should.HaveReturnType(new List { helper.RegularClassSystemType, helper.OtherRegularClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(helper.RegularClass, helper.OtherRegularClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { helper.RegularClass, helper.OtherRegularClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(helper.RegularClassSystemType, helper.OtherRegularClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { helper.RegularClassSystemType, helper.OtherRegularClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.MethodReturningRegularClass, helper.MethodReturningOtherRegularClass).Should().HaveReturnType(helper.RegularClass).AssertAnyViolations(helper); + MethodMembers().That().Are(helper.MethodReturningRegularClass, helper.MethodReturningOtherRegularClass).Should().HaveReturnType(helper.RegularClass, helper.OtherRegularClass).AssertNoViolations(helper); + + await helper.AssertSnapshotMatches(); + } - public string ReturnTypeMethodString() + [Fact] + public async Task DoNotHaveReturnTypeTest() { - return ""; + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + var should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveReturnType(helper.OtherRegularClass).AssertNoViolations(helper); + should.NotHaveReturnType(helper.OtherRegularClassSystemType).AssertNoViolations(helper); + should.NotHaveReturnType(Types().That().Are(helper.OtherRegularClass)).AssertNoViolations(helper); + should.NotHaveReturnType(new List { helper.OtherRegularClass }).AssertNoViolations(helper); + should.NotHaveReturnType(new List { helper.OtherRegularClassSystemType }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClassSystemType)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(Types().That().Are(helper.OtherRegularClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClassSystemType })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveReturnType(helper.RegularClass).AssertOnlyViolations(helper); + should.NotHaveReturnType(helper.RegularClassSystemType).AssertOnlyViolations(helper); + should.NotHaveReturnType(Types().That().Are(helper.RegularClass)).AssertOnlyViolations(helper); + should.NotHaveReturnType(new List { helper.RegularClass }).AssertOnlyViolations(helper); + should.NotHaveReturnType(new List { helper.RegularClassSystemType }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.RegularClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.RegularClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(Types().That().Are(helper.RegularClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.RegularClass })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.RegularClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple arguments"); + should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); + + // NotHaveReturnType(IEnumerable) condition uses .All(type => !match) — fails if ANY type matches + // With {OtherRegularClass, RegularClass}: OtherRegularClass doesn't match (true) AND RegularClass matches (false) => All = false => violation + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveReturnType(helper.OtherRegularClass, helper.RegularClass).AssertOnlyViolations(helper); + should.NotHaveReturnType(new List { helper.OtherRegularClass, helper.RegularClass }).AssertOnlyViolations(helper); + should.NotHaveReturnType(helper.OtherRegularClassSystemType, helper.RegularClassSystemType).AssertOnlyViolations(helper); + should.NotHaveReturnType(new List { helper.OtherRegularClassSystemType, helper.RegularClassSystemType }).AssertOnlyViolations(helper); + + // DoNotHaveReturnType predicate uses .Any(type => !match) for IEnumerable — passes if ANY type doesn't match + // With {OtherRegularClass, RegularClass}: OtherRegularClass doesn't match (true) => Any = true => passes + // BUT: IEnumerable and IObjectProvider overloads use .All(type => !match) — fails if ANY type matches + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClass, helper.RegularClass)).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClass, helper.RegularClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClassSystemType, helper.RegularClassSystemType)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClassSystemType, helper.RegularClassSystemType })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Multiple inputs"); + MethodMembers().That().Are(helper.MethodReturningRegularClass, helper.MethodReturningOtherRegularClass).Should().NotHaveReturnType(helper.RegularClass).AssertAnyViolations(helper); + + await helper.AssertSnapshotMatches(); } - public ReturnTypeClass ReturnTypeMethodClass() + [Fact] + public async Task BeMethodMembersThatTest() { - return new ReturnTypeClass(); + var helper = new TypeAssemblyTestHelper(); + + helper.AddSnapshotHeader("No Violations"); + MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor).Should().BeMethodMembersThat().AreConstructors().AssertNoViolations(helper); + + helper.AddSnapshotHeader("Violations"); + MethodMembers().That().Are(helper.VirtualMethod).Should().BeMethodMembersThat().AreConstructors().AssertOnlyViolations(helper); + + await helper.AssertSnapshotMatches(); } } } diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt new file mode 100644 index 000000000..1f4f27eb7 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt @@ -0,0 +1,285 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" + + + +===== Multiple arguments ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +===== Empty arguments ===== + +----- Conditions ----- + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false) +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false)" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false) +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false)" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) + + + +===== Type not in architecture ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "AttributeNamespace.ClassWithoutAttributes" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by "AttributeNamespace.ClassWithoutAttributes" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "AttributeNamespace.ClassWithoutAttributes"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by "AttributeNamespace.ClassWithoutAttributes" + + + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "AttributeNamespace.ClassWithoutAttributes" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by "AttributeNamespace.ClassWithoutAttributes" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "AttributeNamespace.ClassWithoutAttributes"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by "AttributeNamespace.ClassWithoutAttributes" + + + +===== Multiple inputs ===== + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod1() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt new file mode 100644 index 000000000..313caba6f --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt @@ -0,0 +1,63 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be a constructor +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are constructors +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor + + + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are constructors +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are constructors +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are constructors" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are constructors + + + +===== Multiple inputs ===== + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" should be a constructor +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Result: True +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt new file mode 100644 index 000000000..976c4d30d --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt @@ -0,0 +1,19 @@ +===== No Violations ===== + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be method members that are constructors +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Message: +All Evaluations passed + +===== Violations ===== + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt new file mode 100644 index 000000000..dc0d56fd0 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt @@ -0,0 +1,63 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be no constructor +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are no constructors +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor + + + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are no constructors +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is not Method members that are no constructors +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are no constructors" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is not Method members that are no constructors + + + +===== Multiple inputs ===== + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be no constructor +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Result: True +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt new file mode 100644 index 000000000..479afa235 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt @@ -0,0 +1,63 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be virtual +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are virtual +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual +Result: False +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual +Message: +"Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual" failed: + System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual + + + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are virtual +Result: False +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not Method members that are virtual +Message: +"Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are virtual" failed: + System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not Method members that are virtual + + + +===== Multiple inputs ===== + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::OtherVirtualMeth... should be virtual +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Result: True +Description: System.Void TypeNamespace.OtherClassWithVirtualMethod::OtherVirtualMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual +Result: True +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Result: False +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual" failed: + System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt new file mode 100644 index 000000000..016269181 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt @@ -0,0 +1,247 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type Types that are "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type Types that are "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" + + + +===== Multiple arguments ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" + + + +===== Multiple inputs ===== + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should not have return type "TypeNamespace.RegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() passed +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should not have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt new file mode 100644 index 000000000..1c255b1fd --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt @@ -0,0 +1,285 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" + + + +===== Multiple arguments ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +===== Empty arguments ===== + +----- Conditions ----- + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false) +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false)" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false) +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false)" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) + + + +===== Type not in architecture ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" + + + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" + + + +===== Multiple inputs ===== + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.OtherCallingCl... should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::AnotherMethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt new file mode 100644 index 000000000..3f12ef4d5 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt @@ -0,0 +1,237 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" + + + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type Types that are "TypeNamespace.OtherRegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type Types that are "TypeNamespace.OtherRegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" + + + +===== Multiple arguments ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Message: +All Evaluations passed + +===== Multiple inputs ===== + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should have return type "TypeNamespace.RegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Result: False +Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() has return type "TypeNamespace.OtherRegularClass" +Message: +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should have return type "TypeNamespace.RegularClass"" failed: + TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() has return type "TypeNamespace.OtherRegularClass" + + + +Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Result: True +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Result: True +Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() passed +Message: +All Evaluations passed + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt new file mode 100644 index 000000000..e53178654 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt @@ -0,0 +1,273 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" + + + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" + + + +===== Multiple arguments ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +===== Empty arguments ===== + +----- Conditions ----- + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always false) +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +===== Type not in architecture ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "AttributeNamespace.ClassWithoutAttributes" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "AttributeNamespace.ClassWithoutAttributes" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +===== Multiple inputs ===== + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" or "System.Void MethodDependencyNamespace.OtherCalli... should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt new file mode 100644 index 000000000..dfb2195a4 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt @@ -0,0 +1,63 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should not be virtual +Result: True +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are not virtual +Result: True +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual + + + +----- Predicates ----- + +Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are not virtual +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are not virtual +Message: +"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are not virtual" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are not virtual + + + +===== Multiple inputs ===== + +Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.String TypeNamespace.ClassWithStringReturnType::MethodRetu... should not be virtual +Result: True +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Result: True +Description: System.String TypeNamespace.ClassWithStringReturnType::MethodReturningString() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual +Result: False +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual +Result: True +Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Message: +"Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual" failed: + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual + + + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt new file mode 100644 index 000000000..4662d45ec --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt @@ -0,0 +1,273 @@ +===== No Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +===== Violations ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + +===== Multiple arguments ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +===== Empty arguments ===== + +----- Conditions ----- + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +===== Type not in architecture ===== + +----- Conditions ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +===== Multiple inputs ===== + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" or "System.Void MethodDependencyNamespace.MethodDepe... should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" + + + diff --git a/TestAssemblies/MethodDependencyAssembly/MethodDependency.cs b/TestAssemblies/MethodDependencyAssembly/MethodDependency.cs index b57bea6e2..352b24231 100644 --- a/TestAssemblies/MethodDependencyAssembly/MethodDependency.cs +++ b/TestAssemblies/MethodDependencyAssembly/MethodDependency.cs @@ -24,3 +24,18 @@ public void CalledMethod3() { } public void MethodWithoutDependencies() { } } + +public class OtherCallingClass +{ + public void MethodCallingCalledMethod() + { + var dep = new MethodDependencyClass(); + dep.CalledMethod(); + } + + public void AnotherMethodCallingCalledMethod() + { + var dep = new MethodDependencyClass(); + dep.CalledMethod1(); + } +} diff --git a/TestAssemblies/TypeAssembly/Type.cs b/TestAssemblies/TypeAssembly/Type.cs index 3a6d36f96..6a0955d07 100644 --- a/TestAssemblies/TypeAssembly/Type.cs +++ b/TestAssemblies/TypeAssembly/Type.cs @@ -152,3 +152,51 @@ public class ClassWithStaticMethod { public static void StaticMethod() { } } + +// Method member test classes +public class ClassWithVirtualMethod +{ + public virtual void VirtualMethod() { } +} + +public class OtherClassWithVirtualMethod +{ + public virtual void OtherVirtualMethod() { } +} + +public class ClassWithNonVirtualMethod +{ + public void NonVirtualMethod() { } +} + +public class ClassWithStringReturnType +{ + public string MethodReturningString() + { + return ""; + } +} + +public class ClassWithIntReturnType +{ + public int MethodReturningInt() + { + return 0; + } +} + +public class ClassWithRegularClassReturnType +{ + public RegularClass MethodReturningRegularClass() + { + return new RegularClass(); + } +} + +public class ClassWithOtherRegularClassReturnType +{ + public OtherRegularClass MethodReturningOtherRegularClass() + { + return new OtherRegularClass(); + } +} From 63eed031a516002caeaac1137b26bc1dfe24ae47 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Fri, 12 Jun 2026 14:48:19 +0200 Subject: [PATCH 2/6] refactor: deduplicate implementation of method member syntax elements Signed-off-by: Alexander Linne --- .../MethodMembers/AddMethodMemberCondition.cs | 51 +- .../MethodMembers/AddMethodMemberPredicate.cs | 51 +- .../IAddMethodMemberCondition.cs | 36 +- .../IAddMethodMemberPredicate.cs | 36 +- .../MethodMemberConditionsDefinition.cs | 1040 +++-------------- .../MethodMemberPredicatesDefinition.cs | 616 ++-------- .../TypeAssemblyTestHelper.cs | 29 + .../Elements/MatchGenericReturnTypesTests.cs | 218 ---- .../MethodMemberSyntaxElementsTests.cs | 126 +- ...xElementsTests.BeCalledByTest.verified.txt | 82 +- ...Tests.BeMethodMembersThatTest.verified.txt | 4 +- ...Tests.DoNotHaveReturnTypeTest.verified.txt | 132 ++- ...eDependencyInMethodBodyToTest.verified.txt | 82 +- ...mentsTests.HaveReturnTypeTest.verified.txt | 120 ++ ...ementsTests.NotBeCalledByTest.verified.txt | 56 +- ...eDependencyInMethodBodyToTest.verified.txt | 54 +- TestAssemblies/TypeAssembly/Type.cs | 23 + 17 files changed, 915 insertions(+), 1841 deletions(-) delete mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/MatchGenericReturnTypesTests.cs diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberCondition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberCondition.cs index c2a001207..ace9401a2 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberCondition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberCondition.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using ArchUnitNET.Domain; +using ArchUnitNET.Domain.Extensions; using ArchUnitNET.Fluent.Conditions; namespace ArchUnitNET.Fluent.Syntax.Elements.Members.MethodMembers @@ -17,22 +18,25 @@ internal AddMethodMemberCondition(IArchRuleCreator ruleCreator) public TNextElement BeVirtual() => CreateNextElement(MethodMemberConditionsDefinition.BeVirtual()); - public TNextElement BeCalledBy(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.BeCalledBy(firstType, moreTypes)); - public TNextElement BeCalledBy(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.BeCalledBy(type, moreTypes)); + public TNextElement BeCalledBy() => BeCalledBy(new ObjectProvider()); + public TNextElement BeCalledBy(params IType[] types) => BeCalledBy(new ObjectProvider(types)); + public TNextElement BeCalledBy(params Type[] types) => BeCalledBy(new SystemTypeObjectProvider(types)); public TNextElement BeCalledBy(IObjectProvider types) => CreateNextElement(MethodMemberConditionsDefinition.BeCalledBy(types)); - public TNextElement BeCalledBy(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.BeCalledBy(types)); - public TNextElement BeCalledBy(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.BeCalledBy(types)); + public TNextElement BeCalledBy(IEnumerable types) => BeCalledBy(new ObjectProvider(types)); + public TNextElement BeCalledBy(IEnumerable types) => BeCalledBy(new SystemTypeObjectProvider(types)); - public TNextElement HaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.HaveDependencyInMethodBodyTo(firstType, moreTypes)); - public TNextElement HaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.HaveDependencyInMethodBodyTo(type, moreTypes)); + public TNextElement HaveDependencyInMethodBodyTo() => HaveDependencyInMethodBodyTo(new ObjectProvider()); + public TNextElement HaveDependencyInMethodBodyTo(params IType[] types) => HaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement HaveDependencyInMethodBodyTo(params Type[] types) => HaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); public TNextElement HaveDependencyInMethodBodyTo(IObjectProvider types) => CreateNextElement(MethodMemberConditionsDefinition.HaveDependencyInMethodBodyTo(types)); - public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.HaveDependencyInMethodBodyTo(types)); - public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.HaveDependencyInMethodBodyTo(types)); + public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => HaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => HaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); - public TNextElement HaveReturnType(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.HaveReturnType(firstType, moreTypes)); - public TNextElement HaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.HaveReturnType(types)); + public TNextElement HaveReturnType() => HaveReturnType(new ObjectProvider()); + public TNextElement HaveReturnType(params IType[] types) => HaveReturnType(new ObjectProvider(types)); + public TNextElement HaveReturnType(params Type[] types) => HaveReturnType((IEnumerable)types); public TNextElement HaveReturnType(IObjectProvider types) => CreateNextElement(MethodMemberConditionsDefinition.HaveReturnType(types)); - public TNextElement HaveReturnType(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.HaveReturnType(type, moreTypes)); + public TNextElement HaveReturnType(IEnumerable types) => HaveReturnType(new ObjectProvider(types)); public TNextElement HaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.HaveReturnType(types)); public ShouldRelateToMethodMembersThat BeMethodMembersThat() => BeginComplexMethodMemberCondition(MethodMemberConditionsDefinition.BeMethodMembersThat()); @@ -43,22 +47,25 @@ internal AddMethodMemberCondition(IArchRuleCreator ruleCreator) public TNextElement NotBeVirtual() => CreateNextElement(MethodMemberConditionsDefinition.NotBeVirtual()); - public TNextElement NotBeCalledBy(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.NotBeCalledBy(firstType, moreTypes)); - public TNextElement NotBeCalledBy(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.NotBeCalledBy(type, moreTypes)); + public TNextElement NotBeCalledBy() => NotBeCalledBy(new ObjectProvider()); + public TNextElement NotBeCalledBy(params IType[] types) => NotBeCalledBy(new ObjectProvider(types)); + public TNextElement NotBeCalledBy(params Type[] types) => NotBeCalledBy(new SystemTypeObjectProvider(types)); public TNextElement NotBeCalledBy(IObjectProvider types) => CreateNextElement(MethodMemberConditionsDefinition.NotBeCalledBy(types)); - public TNextElement NotBeCalledBy(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.NotBeCalledBy(types)); - public TNextElement NotBeCalledBy(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.NotBeCalledBy(types)); + public TNextElement NotBeCalledBy(IEnumerable types) => NotBeCalledBy(new ObjectProvider(types)); + public TNextElement NotBeCalledBy(IEnumerable types) => NotBeCalledBy(new SystemTypeObjectProvider(types)); - public TNextElement NotHaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveDependencyInMethodBodyTo(firstType, moreTypes)); - public TNextElement NotHaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveDependencyInMethodBodyTo(type, moreTypes)); + public TNextElement NotHaveDependencyInMethodBodyTo() => NotHaveDependencyInMethodBodyTo(new ObjectProvider()); + public TNextElement NotHaveDependencyInMethodBodyTo(params IType[] types) => NotHaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement NotHaveDependencyInMethodBodyTo(params Type[] types) => NotHaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); public TNextElement NotHaveDependencyInMethodBodyTo(IObjectProvider types) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveDependencyInMethodBodyTo(types)); - public TNextElement NotHaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveDependencyInMethodBodyTo(types)); - public TNextElement NotHaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveDependencyInMethodBodyTo(types)); + public TNextElement NotHaveDependencyInMethodBodyTo(IEnumerable types) => NotHaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement NotHaveDependencyInMethodBodyTo(IEnumerable types) => NotHaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); - public TNextElement NotHaveReturnType(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveReturnType(firstType, moreTypes)); - public TNextElement NotHaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveReturnType(types)); + public TNextElement NotHaveReturnType() => NotHaveReturnType(new ObjectProvider()); + public TNextElement NotHaveReturnType(params IType[] types) => NotHaveReturnType(new ObjectProvider(types)); + public TNextElement NotHaveReturnType(params Type[] types) => NotHaveReturnType((IEnumerable)types); public TNextElement NotHaveReturnType(IObjectProvider types) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveReturnType(types)); - public TNextElement NotHaveReturnType(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveReturnType(type, moreTypes)); + public TNextElement NotHaveReturnType(IEnumerable types) => NotHaveReturnType(new ObjectProvider(types)); public TNextElement NotHaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberConditionsDefinition.NotHaveReturnType(types)); // csharpier-ignore-end } diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberPredicate.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberPredicate.cs index c36993def..33a98d8e3 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberPredicate.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/AddMethodMemberPredicate.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using ArchUnitNET.Domain; +using ArchUnitNET.Domain.Extensions; namespace ArchUnitNET.Fluent.Syntax.Elements.Members.MethodMembers { @@ -17,22 +18,25 @@ internal AddMethodMemberPredicate(IArchRuleCreator ruleCreator) public TNextElement AreVirtual() => CreateNextElement(MethodMemberPredicatesDefinition.AreVirtual()); - public TNextElement AreCalledBy(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.AreCalledBy(firstType, moreTypes)); - public TNextElement AreCalledBy(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.AreCalledBy(type, moreTypes)); + public TNextElement AreCalledBy() => AreCalledBy(new ObjectProvider()); + public TNextElement AreCalledBy(params IType[] types) => AreCalledBy(new ObjectProvider(types)); + public TNextElement AreCalledBy(params Type[] types) => AreCalledBy(new SystemTypeObjectProvider(types)); public TNextElement AreCalledBy(IObjectProvider types) => CreateNextElement(MethodMemberPredicatesDefinition.AreCalledBy(types)); - public TNextElement AreCalledBy(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.AreCalledBy(types)); - public TNextElement AreCalledBy(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.AreCalledBy(types)); + public TNextElement AreCalledBy(IEnumerable types) => AreCalledBy(new ObjectProvider(types)); + public TNextElement AreCalledBy(IEnumerable types) => AreCalledBy(new SystemTypeObjectProvider(types)); - public TNextElement HaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.HaveDependencyInMethodBodyTo(firstType, moreTypes)); - public TNextElement HaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.HaveDependencyInMethodBodyTo(type, moreTypes)); + public TNextElement HaveDependencyInMethodBodyTo() => HaveDependencyInMethodBodyTo(new ObjectProvider()); + public TNextElement HaveDependencyInMethodBodyTo(params IType[] types) => HaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement HaveDependencyInMethodBodyTo(params Type[] types) => HaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); public TNextElement HaveDependencyInMethodBodyTo(IObjectProvider types) => CreateNextElement(MethodMemberPredicatesDefinition.HaveDependencyInMethodBodyTo(types)); - public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.HaveDependencyInMethodBodyTo(types)); - public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.HaveDependencyInMethodBodyTo(types)); + public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => HaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement HaveDependencyInMethodBodyTo(IEnumerable types) => HaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); - public TNextElement HaveReturnType(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.HaveReturnType(firstType, moreTypes)); - public TNextElement HaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.HaveReturnType(types)); + public TNextElement HaveReturnType() => HaveReturnType(new ObjectProvider()); + public TNextElement HaveReturnType(params IType[] types) => HaveReturnType(new ObjectProvider(types)); + public TNextElement HaveReturnType(params Type[] types) => HaveReturnType((IEnumerable)types); public TNextElement HaveReturnType(IObjectProvider types) => CreateNextElement(MethodMemberPredicatesDefinition.HaveReturnType(types)); - public TNextElement HaveReturnType(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.HaveReturnType(type, moreTypes)); + public TNextElement HaveReturnType(IEnumerable types) => HaveReturnType(new ObjectProvider(types)); public TNextElement HaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.HaveReturnType(types)); //Negations @@ -41,22 +45,25 @@ internal AddMethodMemberPredicate(IArchRuleCreator ruleCreator) public TNextElement AreNotVirtual() => CreateNextElement(MethodMemberPredicatesDefinition.AreNotVirtual()); - public TNextElement AreNotCalledBy(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.AreNotCalledBy(firstType, moreTypes)); - public TNextElement AreNotCalledBy(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.AreNotCalledBy(type, moreTypes)); + public TNextElement AreNotCalledBy() => AreNotCalledBy(new ObjectProvider()); + public TNextElement AreNotCalledBy(params IType[] types) => AreNotCalledBy(new ObjectProvider(types)); + public TNextElement AreNotCalledBy(params Type[] types) => AreNotCalledBy(new SystemTypeObjectProvider(types)); public TNextElement AreNotCalledBy(IObjectProvider types) => CreateNextElement(MethodMemberPredicatesDefinition.AreNotCalledBy(types)); - public TNextElement AreNotCalledBy(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.AreNotCalledBy(types)); - public TNextElement AreNotCalledBy(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.AreNotCalledBy(types)); + public TNextElement AreNotCalledBy(IEnumerable types) => AreNotCalledBy(new ObjectProvider(types)); + public TNextElement AreNotCalledBy(IEnumerable types) => AreNotCalledBy(new SystemTypeObjectProvider(types)); - public TNextElement DoNotHaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveDependencyInMethodBodyTo(firstType, moreTypes)); - public TNextElement DoNotHaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveDependencyInMethodBodyTo(type, moreTypes)); + public TNextElement DoNotHaveDependencyInMethodBodyTo() => DoNotHaveDependencyInMethodBodyTo(new ObjectProvider()); + public TNextElement DoNotHaveDependencyInMethodBodyTo(params IType[] types) => DoNotHaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement DoNotHaveDependencyInMethodBodyTo(params Type[] types) => DoNotHaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); public TNextElement DoNotHaveDependencyInMethodBodyTo(IObjectProvider types) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveDependencyInMethodBodyTo(types)); - public TNextElement DoNotHaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveDependencyInMethodBodyTo(types)); - public TNextElement DoNotHaveDependencyInMethodBodyTo(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveDependencyInMethodBodyTo(types)); + public TNextElement DoNotHaveDependencyInMethodBodyTo(IEnumerable types) => DoNotHaveDependencyInMethodBodyTo(new ObjectProvider(types)); + public TNextElement DoNotHaveDependencyInMethodBodyTo(IEnumerable types) => DoNotHaveDependencyInMethodBodyTo(new SystemTypeObjectProvider(types)); - public TNextElement DoNotHaveReturnType(IType firstType, params IType[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveReturnType(firstType, moreTypes)); - public TNextElement DoNotHaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveReturnType(types)); + public TNextElement DoNotHaveReturnType() => DoNotHaveReturnType(new ObjectProvider()); + public TNextElement DoNotHaveReturnType(params IType[] types) => DoNotHaveReturnType(new ObjectProvider(types)); + public TNextElement DoNotHaveReturnType(params Type[] types) => DoNotHaveReturnType((IEnumerable)types); public TNextElement DoNotHaveReturnType(IObjectProvider types) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveReturnType(types)); - public TNextElement DoNotHaveReturnType(Type type, params Type[] moreTypes) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveReturnType(type, moreTypes)); + public TNextElement DoNotHaveReturnType(IEnumerable types) => DoNotHaveReturnType(new ObjectProvider(types)); public TNextElement DoNotHaveReturnType(IEnumerable types) => CreateNextElement(MethodMemberPredicatesDefinition.DoNotHaveReturnType(types)); // csharpier-ignore-end diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberCondition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberCondition.cs index cc559b773..15af4a0a0 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberCondition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberCondition.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using ArchUnitNET.Domain; @@ -11,22 +11,25 @@ public interface IAddMethodMemberCondition TNextElement BeConstructor(); TNextElement BeVirtual(); - TNextElement BeCalledBy(IType firstType, params IType[] moreTypes); - TNextElement BeCalledBy(Type type, params Type[] moreTypes); + TNextElement BeCalledBy(); + TNextElement BeCalledBy(params IType[] types); + TNextElement BeCalledBy(params Type[] types); TNextElement BeCalledBy(IObjectProvider types); TNextElement BeCalledBy(IEnumerable types); TNextElement BeCalledBy(IEnumerable types); - TNextElement HaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes); - TNextElement HaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes); + TNextElement HaveDependencyInMethodBodyTo(); + TNextElement HaveDependencyInMethodBodyTo(params IType[] types); + TNextElement HaveDependencyInMethodBodyTo(params Type[] types); TNextElement HaveDependencyInMethodBodyTo(IObjectProvider types); TNextElement HaveDependencyInMethodBodyTo(IEnumerable types); TNextElement HaveDependencyInMethodBodyTo(IEnumerable types); - TNextElement HaveReturnType(IType firstType, params IType[] moreTypes); - TNextElement HaveReturnType(IEnumerable types); + TNextElement HaveReturnType(); + TNextElement HaveReturnType(params IType[] types); + TNextElement HaveReturnType(params Type[] types); TNextElement HaveReturnType(IObjectProvider types); - TNextElement HaveReturnType(Type type, params Type[] moreTypes); + TNextElement HaveReturnType(IEnumerable types); TNextElement HaveReturnType(IEnumerable types); //Negations @@ -34,22 +37,25 @@ public interface IAddMethodMemberCondition TNextElement BeNoConstructor(); TNextElement NotBeVirtual(); - TNextElement NotBeCalledBy(IType firstType, params IType[] moreTypes); - TNextElement NotBeCalledBy(Type type, params Type[] moreTypes); + TNextElement NotBeCalledBy(); + TNextElement NotBeCalledBy(params IType[] types); + TNextElement NotBeCalledBy(params Type[] types); TNextElement NotBeCalledBy(IObjectProvider types); TNextElement NotBeCalledBy(IEnumerable types); TNextElement NotBeCalledBy(IEnumerable types); - TNextElement NotHaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes); - TNextElement NotHaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes); + TNextElement NotHaveDependencyInMethodBodyTo(); + TNextElement NotHaveDependencyInMethodBodyTo(params IType[] types); + TNextElement NotHaveDependencyInMethodBodyTo(params Type[] types); TNextElement NotHaveDependencyInMethodBodyTo(IObjectProvider types); TNextElement NotHaveDependencyInMethodBodyTo(IEnumerable types); TNextElement NotHaveDependencyInMethodBodyTo(IEnumerable types); - TNextElement NotHaveReturnType(IType firstType, params IType[] moreTypes); - TNextElement NotHaveReturnType(IEnumerable types); + TNextElement NotHaveReturnType(); + TNextElement NotHaveReturnType(params IType[] types); + TNextElement NotHaveReturnType(params Type[] types); TNextElement NotHaveReturnType(IObjectProvider types); - TNextElement NotHaveReturnType(Type type, params Type[] moreTypes); + TNextElement NotHaveReturnType(IEnumerable types); TNextElement NotHaveReturnType(IEnumerable types); } } diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberPredicate.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberPredicate.cs index 4e81ced73..dadd93413 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberPredicate.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/IAddMethodMemberPredicate.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using ArchUnitNET.Domain; @@ -11,22 +11,25 @@ public interface IAddMethodMemberPredicate TNextElement AreConstructors(); TNextElement AreVirtual(); - TNextElement AreCalledBy(IType firstType, params IType[] moreTypes); - TNextElement AreCalledBy(Type type, params Type[] moreTypes); + TNextElement AreCalledBy(); + TNextElement AreCalledBy(params IType[] types); + TNextElement AreCalledBy(params Type[] types); TNextElement AreCalledBy(IObjectProvider types); TNextElement AreCalledBy(IEnumerable types); TNextElement AreCalledBy(IEnumerable types); - TNextElement HaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes); - TNextElement HaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes); + TNextElement HaveDependencyInMethodBodyTo(); + TNextElement HaveDependencyInMethodBodyTo(params IType[] types); + TNextElement HaveDependencyInMethodBodyTo(params Type[] types); TNextElement HaveDependencyInMethodBodyTo(IObjectProvider types); TNextElement HaveDependencyInMethodBodyTo(IEnumerable types); TNextElement HaveDependencyInMethodBodyTo(IEnumerable types); - TNextElement HaveReturnType(IType firstType, params IType[] moreTypes); - TNextElement HaveReturnType(IEnumerable types); + TNextElement HaveReturnType(); + TNextElement HaveReturnType(params IType[] types); + TNextElement HaveReturnType(params Type[] types); TNextElement HaveReturnType(IObjectProvider types); - TNextElement HaveReturnType(Type type, params Type[] moreTypes); + TNextElement HaveReturnType(IEnumerable types); TNextElement HaveReturnType(IEnumerable types); //Negations @@ -34,22 +37,25 @@ public interface IAddMethodMemberPredicate TNextElement AreNoConstructors(); TNextElement AreNotVirtual(); - TNextElement AreNotCalledBy(IType firstType, params IType[] moreTypes); - TNextElement AreNotCalledBy(Type type, params Type[] moreTypes); + TNextElement AreNotCalledBy(); + TNextElement AreNotCalledBy(params IType[] types); + TNextElement AreNotCalledBy(params Type[] types); TNextElement AreNotCalledBy(IObjectProvider types); TNextElement AreNotCalledBy(IEnumerable types); TNextElement AreNotCalledBy(IEnumerable types); - TNextElement DoNotHaveDependencyInMethodBodyTo(IType firstType, params IType[] moreTypes); - TNextElement DoNotHaveDependencyInMethodBodyTo(Type type, params Type[] moreTypes); + TNextElement DoNotHaveDependencyInMethodBodyTo(); + TNextElement DoNotHaveDependencyInMethodBodyTo(params IType[] types); + TNextElement DoNotHaveDependencyInMethodBodyTo(params Type[] types); TNextElement DoNotHaveDependencyInMethodBodyTo(IObjectProvider types); TNextElement DoNotHaveDependencyInMethodBodyTo(IEnumerable types); TNextElement DoNotHaveDependencyInMethodBodyTo(IEnumerable types); - TNextElement DoNotHaveReturnType(IType firstType, params IType[] moreTypes); - TNextElement DoNotHaveReturnType(IEnumerable types); + TNextElement DoNotHaveReturnType(); + TNextElement DoNotHaveReturnType(params IType[] types); + TNextElement DoNotHaveReturnType(params Type[] types); TNextElement DoNotHaveReturnType(IObjectProvider types); - TNextElement DoNotHaveReturnType(Type type, params Type[] moreTypes); + TNextElement DoNotHaveReturnType(IEnumerable types); TNextElement DoNotHaveReturnType(IEnumerable types); } } diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs index b2739b35c..08d8325cc 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using ArchUnitNET.Domain; -using ArchUnitNET.Domain.Exceptions; using ArchUnitNET.Domain.Extensions; using ArchUnitNET.Fluent.Conditions; +using static ArchUnitNET.Domain.Extensions.EnumerableExtensions; namespace ArchUnitNET.Fluent.Syntax.Elements.Members.MethodMembers { @@ -37,26 +37,6 @@ public static IOrderedCondition BeVirtual() ); } - public static IOrderedCondition BeCalledBy( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return BeCalledBy(types); - } - - public static IOrderedCondition BeCalledBy( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return BeCalledBy(types); - } - public static IOrderedCondition BeCalledBy( IObjectProvider objectProvider ) @@ -66,186 +46,32 @@ IEnumerable Condition( Architecture architecture ) { - var typeList = objectProvider.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => methodMember.GetCallingTypes().Intersect(typeList).Any()) - .ToList(); - var failDescription = "is not called by " + objectProvider.Description; - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in passedObjects) - { - yield return new ConditionResult(passedObject, true); - } - } - - var description = "be called by " + objectProvider.Description; - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition BeCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - var firstType = typeList.First(); - - IEnumerable Condition(IEnumerable methodMembers) - { - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => methodMember.GetCallingTypes().Intersect(typeList).Any()) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = "is not called by one of no types (always true)"; - } - else - { - failDescription = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "is not called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in passedObjects) - { - yield return new ConditionResult(passedObject, true); - } - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "be called by one of no types (always false)"; - } - else - { - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "be called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new EnumerableCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition BeCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - var firstType = typeList.First(); - - IEnumerable Condition( - IEnumerable methodMembers, - Architecture architecture - ) - { - var archUnitTypeList = new List(); - foreach (var type in typeList) + var isRequiredType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + foreach (var methodMember in methodMembers) { - try + if (methodMember.GetCallingTypes().Any(isRequiredType)) { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); + yield return new ConditionResult(methodMember, true); } - catch (TypeDoesNotExistInArchitecture) + else { - //ignore, can't have a dependency anyways - } - } - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => - methodMember.GetCallingTypes().Intersect(archUnitTypeList).Any() - ) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = "is not called by one of no types (always true)"; - } - else - { - failDescription = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "is not called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" + yield return new ConditionResult( + methodMember, + false, + "is not called by " + objectProvider.Description ); + } } - - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in passedObjects) - { - yield return new ConditionResult(passedObject, true); - } - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "be called by one of no types (always false)"; - } - else - { - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "be called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); } - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition HaveDependencyInMethodBodyTo( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveDependencyInMethodBodyTo(types); - } - - public static IOrderedCondition HaveDependencyInMethodBodyTo( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveDependencyInMethodBodyTo(types); + var description = objectProvider.FormatDescription( + "be called by one of no types (impossible)", + "be called by", + "be called by any" + ); + return new OrderedArchitectureCondition(Condition, description); } public static IOrderedCondition HaveDependencyInMethodBodyTo( @@ -257,287 +83,112 @@ IEnumerable Condition( Architecture architecture ) { - var typeList = objectProvider.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => - methodMember - .GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(typeList) - .Any() - ) - .ToList(); - var failDescription = - "does not have dependencies in method body to " + objectProvider.Description; - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in passedObjects) + var isRequiredType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + foreach (var methodMember in methodMembers) { - yield return new ConditionResult(passedObject, true); - } - } - - var description = "have dependencies in method body to " + objectProvider.Description; - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition HaveDependencyInMethodBodyTo( - IEnumerable types - ) - { - var typeList = types.ToList(); - var firstType = typeList.First(); - - IEnumerable Condition(IEnumerable methodMembers) - { - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => + if ( methodMember .GetBodyTypeMemberDependencies() .Select(dependency => dependency.Target) - .Intersect(typeList) - .Any() + .Any(isRequiredType) ) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = - "does not have dependencies in method body to one of no types (always true)"; - } - else - { - failDescription = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "does not have dependencies in method body to \"" - + firstType.FullName - + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" + { + yield return new ConditionResult(methodMember, true); + } + else + { + yield return new ConditionResult( + methodMember, + false, + "does not have dependencies in method body to " + + objectProvider.Description ); + } } - - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in passedObjects) - { - yield return new ConditionResult(passedObject, true); - } - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "have dependencies in method body to one of no types (always false)"; - } - else - { - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); } - return new EnumerableCondition( - Condition, - description - ).AsOrderedCondition(); + var description = objectProvider.FormatDescription( + "have dependencies in method body to one of no types (impossible)", + "have dependencies in method body to", + "have dependencies in method body to any" + ); + return new OrderedArchitectureCondition(Condition, description); } - public static IOrderedCondition HaveDependencyInMethodBodyTo( - IEnumerable types + public static IOrderedCondition HaveReturnType( + IObjectProvider objectProvider ) { - var typeList = types.ToList(); - var firstType = typeList.First(); - IEnumerable Condition( IEnumerable methodMembers, Architecture architecture ) { - var archUnitTypeList = new List(); - foreach (var type in typeList) + var isRequiredType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + foreach (var methodMember in methodMembers) { - try + if (isRequiredType(methodMember.ReturnType)) { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); + yield return new ConditionResult(methodMember, true); } - catch (TypeDoesNotExistInArchitecture) + else { - //ignore, can't have a dependency anyways - } - } - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => - methodMember - .GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(archUnitTypeList) - .Any() - ) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = - "does not have dependencies in method body to one of no types (always true)"; - } - else - { - failDescription = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "does not have dependencies in method body to \"" - + firstType.FullName - + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" + yield return new ConditionResult( + methodMember, + false, + "has return type \"" + methodMember.ReturnType.FullName + "\"" ); - } - - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in passedObjects) - { - yield return new ConditionResult(passedObject, true); + } } } - string description; - if (typeList.IsNullOrEmpty()) - { - description = "have dependencies in method body to one of no types (always false)"; - } - else - { - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition HaveReturnType( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveReturnType(types); + var description = objectProvider.FormatDescription( + "have return type of no types (impossible)", + "have return type", + "have return type" + ); + return new OrderedArchitectureCondition(Condition, description); } - public static IOrderedCondition HaveReturnType(IEnumerable types) + public static IOrderedCondition HaveReturnType(IEnumerable types) { var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.FullName).ToList(); - var description = - "have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - bool Condition(MethodMember member) - { - return typeList.Any(type => member.ReturnType.FullNameEquals(type.FullName)); - } - - return new SimpleCondition( - Condition, - member => "has return type \"" + member.ReturnType.FullName + "\"", - description - ); - } - - public static IOrderedCondition HaveReturnType(IObjectProvider types) - { IEnumerable Condition( IEnumerable methodMembers, Architecture architecture ) { - var typeList = types.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => - typeList.Any(type => methodMember.ReturnType.FullNameEquals(type.FullName)) - ) - .ToList(); - foreach (var failedObject in methodMemberList.Except(passedObjects)) + foreach (var methodMember in methodMembers) { - yield return new ConditionResult( - failedObject, - false, - "has return type \"" + failedObject.ReturnType.FullName + "\"" - ); - } - - foreach (var passedObject in passedObjects) - { - yield return new ConditionResult(passedObject, true); + if (typeList.Any(type => methodMember.ReturnTypeInstance.MatchesType(type))) + { + yield return new ConditionResult(methodMember, true); + } + else + { + yield return new ConditionResult( + methodMember, + false, + "has return type \"" + methodMember.ReturnType.FullName + "\"" + ); + } } } - var description = "have return type " + types.Description; - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition HaveReturnType( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveReturnType(types); - } - - public static IOrderedCondition HaveReturnType(IEnumerable types) - { - var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.ToString()).ToList(); - var description = - "have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - - bool Condition(MethodMember member) - { - return typeList.Any(type => member.ReturnTypeInstance.MatchesType(type)); - } - - return new SimpleCondition( - Condition, - member => "has return type \"" + member.ReturnType.FullName + "\"", - description + var typeDescription = string.Join( + " or ", + typeList.Select(type => $"\"{type.FullName}\"") ); + var description = + typeList.Count == 0 + ? "have return type of no types (impossible)" + : $"have return type {typeDescription}"; + return new OrderedArchitectureCondition(Condition, description); } //Negations @@ -560,26 +211,6 @@ public static IOrderedCondition NotBeVirtual() ); } - public static IOrderedCondition NotBeCalledBy( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return NotBeCalledBy(types); - } - - public static IOrderedCondition NotBeCalledBy( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return NotBeCalledBy(types); - } - public static IOrderedCondition NotBeCalledBy( IObjectProvider objectProvider ) @@ -589,186 +220,32 @@ IEnumerable Condition( Architecture architecture ) { - var typeList = objectProvider.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - var failedObjects = methodMemberList - .Where(methodMember => methodMember.GetCallingTypes().Intersect(typeList).Any()) - .ToList(); - var failDescription = "is called by " + objectProvider.Description; - foreach (var failedObject in failedObjects) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in methodMemberList.Except(failedObjects)) - { - yield return new ConditionResult(passedObject, true); - } - } - - var description = "not be called by " + objectProvider.Description; - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition NotBeCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - var firstType = typeList.First(); - - IEnumerable Condition(IEnumerable methodMembers) - { - var methodMemberList = methodMembers.ToList(); - var failedObjects = methodMemberList - .Where(methodMember => methodMember.GetCallingTypes().Intersect(typeList).Any()) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = "is called by one of no types (always false)"; - } - else - { - failDescription = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "is called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - foreach (var failedObject in failedObjects) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in methodMemberList.Except(failedObjects)) - { - yield return new ConditionResult(passedObject, true); - } - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "not be called by one of no types (always true)"; - } - else - { - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "not be called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new EnumerableCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition NotBeCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - var firstType = typeList.First(); - - IEnumerable Condition( - IEnumerable methodMembers, - Architecture architecture - ) - { - var archUnitTypeList = new List(); - foreach (var type in typeList) + var isForbiddenType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + foreach (var methodMember in methodMembers) { - try + if (!methodMember.GetCallingTypes().Any(isForbiddenType)) { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); + yield return new ConditionResult(methodMember, true); } - catch (TypeDoesNotExistInArchitecture) + else { - //ignore, can't have a dependency anyways - } - } - var methodMemberList = methodMembers.ToList(); - var failedObjects = methodMemberList - .Where(methodMember => - methodMember.GetCallingTypes().Intersect(archUnitTypeList).Any() - ) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = "is called by one of no types (always false)"; - } - else - { - failDescription = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "is called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" + yield return new ConditionResult( + methodMember, + false, + "is called by " + objectProvider.Description ); + } } - - foreach (var failedObject in failedObjects) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in methodMemberList.Except(failedObjects)) - { - yield return new ConditionResult(passedObject, true); - } - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "not be called by one of no types (always true)"; } - else - { - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "not be called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - public static IOrderedCondition NotHaveDependencyInMethodBodyTo( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return NotHaveDependencyInMethodBodyTo(types); - } - - public static IOrderedCondition NotHaveDependencyInMethodBodyTo( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return NotHaveDependencyInMethodBodyTo(types); + var description = objectProvider.FormatDescription( + "not be called by one of no types (always true)", + "not be called by", + "not be called by any" + ); + return new OrderedArchitectureCondition(Condition, description); } public static IOrderedCondition NotHaveDependencyInMethodBodyTo( @@ -780,292 +257,111 @@ IEnumerable Condition( Architecture architecture ) { - var typeList = objectProvider.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - var failedObjects = methodMemberList - .Where(methodMember => - methodMember - .GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(typeList) - .Any() - ) - .ToList(); - var failDescription = - "does have dependencies in method body to " + objectProvider.Description; - foreach (var failedObject in failedObjects) + var isForbiddenType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + foreach (var methodMember in methodMembers) { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in methodMemberList.Except(failedObjects)) - { - yield return new ConditionResult(passedObject, true); - } - } - - var description = - "not have dependencies in method body to " + objectProvider.Description; - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition NotHaveDependencyInMethodBodyTo( - IEnumerable types - ) - { - var typeList = types.ToList(); - var firstType = typeList.First(); - - IEnumerable Condition(IEnumerable methodMembers) - { - var methodMemberList = methodMembers.ToList(); - var failedObjects = methodMemberList - .Where(methodMember => - methodMember + if ( + !methodMember .GetBodyTypeMemberDependencies() .Select(dependency => dependency.Target) - .Intersect(typeList) - .Any() + .Any(isForbiddenType) ) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = - "does have dependencies in method body to one of no types (always false)"; - } - else - { - failDescription = typeList - .Where(type => !Equals(type, firstType)) - .Distinct() - .Aggregate( - "does have dependencies in method body to \"" - + firstType.FullName - + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" + { + yield return new ConditionResult(methodMember, true); + } + else + { + yield return new ConditionResult( + methodMember, + false, + "does have dependencies in method body to " + objectProvider.Description ); + } } - - foreach (var failedObject in failedObjects) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in methodMemberList.Except(failedObjects)) - { - yield return new ConditionResult(passedObject, true); - } - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = - "not have dependencies in method body to one of no types (always true)"; - } - else - { - description = typeList - .Where(type => !Equals(type, firstType)) - .Distinct() - .Aggregate( - "not have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); } - return new EnumerableCondition( - Condition, - description - ).AsOrderedCondition(); + var description = objectProvider.FormatDescription( + "not have dependencies in method body to one of no types (always true)", + "not have dependencies in method body to", + "not have dependencies in method body to any" + ); + return new OrderedArchitectureCondition(Condition, description); } - public static IOrderedCondition NotHaveDependencyInMethodBodyTo( - IEnumerable types + public static IOrderedCondition NotHaveReturnType( + IObjectProvider objectProvider ) { - var typeList = types.ToList(); - var firstType = typeList.First(); - IEnumerable Condition( IEnumerable methodMembers, Architecture architecture ) { - var archUnitTypeList = new List(); - foreach (var type in typeList) + var isForbiddenType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + foreach (var methodMember in methodMembers) { - try + if (!isForbiddenType(methodMember.ReturnType)) { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); + yield return new ConditionResult(methodMember, true); } - catch (TypeDoesNotExistInArchitecture) + else { - //ignore, can't have a dependency anyways - } - } - var methodMemberList = methodMembers.ToList(); - var failedObjects = methodMemberList - .Where(methodMember => - methodMember - .GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(archUnitTypeList) - .Any() - ) - .ToList(); - string failDescription; - if (typeList.IsNullOrEmpty()) - { - failDescription = - "does have dependencies in method body to one of no types (always false)"; - } - else - { - failDescription = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "does have dependencies in method body to \"" - + firstType.FullName - + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" + yield return new ConditionResult( + methodMember, + false, + "has return type \"" + methodMember.ReturnType.FullName + "\"" ); - } - - foreach (var failedObject in failedObjects) - { - yield return new ConditionResult(failedObject, false, failDescription); - } - - foreach (var passedObject in methodMemberList.Except(failedObjects)) - { - yield return new ConditionResult(passedObject, true); + } } } - string description; - if (typeList.IsNullOrEmpty()) - { - description = - "not have dependencies in method body to one of no types (always true)"; - } - else - { - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "not have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition NotHaveReturnType( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return NotHaveReturnType(types); + var description = objectProvider.FormatDescription( + "not have return type of no types (always true)", + "not have return type", + "not have return type" + ); + return new OrderedArchitectureCondition(Condition, description); } - public static IOrderedCondition NotHaveReturnType(IEnumerable types) + public static IOrderedCondition NotHaveReturnType(IEnumerable types) { var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.FullName).ToList(); - var description = - "not have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - bool Condition(MethodMember member) - { - return typeList.All(type => !member.ReturnType.FullNameEquals(type.FullName)); - } - - return new SimpleCondition( - Condition, - member => "has return type \"" + member.ReturnType.FullName + "\"", - description - ); - } - - public static IOrderedCondition NotHaveReturnType( - IObjectProvider types - ) - { IEnumerable Condition( IEnumerable methodMembers, Architecture architecture ) { - var typeList = types.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - var passedObjects = methodMemberList - .Where(methodMember => - typeList.All(type => !methodMember.ReturnType.FullNameEquals(type.FullName)) - ) - .ToList(); - foreach (var failedObject in methodMemberList.Except(passedObjects)) - { - yield return new ConditionResult( - failedObject, - false, - "has return type \"" + failedObject.ReturnType.FullName + "\"" - ); - } - - foreach (var passedObject in passedObjects) + foreach (var methodMember in methodMembers) { - yield return new ConditionResult(passedObject, true); + if (typeList.All(type => !methodMember.ReturnTypeInstance.MatchesType(type))) + { + yield return new ConditionResult(methodMember, true); + } + else + { + yield return new ConditionResult( + methodMember, + false, + "has return type \"" + methodMember.ReturnType.FullName + "\"" + ); + } } } - var description = "not have return type " + types.Description; - return new ArchitectureCondition( - Condition, - description - ).AsOrderedCondition(); - } - - public static IOrderedCondition NotHaveReturnType( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return NotHaveReturnType(types); - } - - public static IOrderedCondition NotHaveReturnType(IEnumerable types) - { - var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.ToString()).ToList(); - var description = - "not have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - - bool Condition(MethodMember member) - { - return typeList.All(type => !member.ReturnTypeInstance.MatchesType(type)); - } - - return new SimpleCondition( - Condition, - member => "has return type \"" + member.ReturnType.FullName + "\"", - description + var typeDescription = string.Join( + " or ", + typeList.Select(type => $"\"{type.FullName}\"") ); + var description = + typeList.Count == 0 + ? "not have return type of no types (always true)" + : $"not have return type {typeDescription}"; + return new OrderedArchitectureCondition(Condition, description); } } } diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberPredicatesDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberPredicatesDefinition.cs index 1e576f656..a2d6b3092 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberPredicatesDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberPredicatesDefinition.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using ArchUnitNET.Domain; -using ArchUnitNET.Domain.Exceptions; using ArchUnitNET.Domain.Extensions; using ArchUnitNET.Fluent.Predicates; +using static ArchUnitNET.Domain.Extensions.EnumerableExtensions; namespace ArchUnitNET.Fluent.Syntax.Elements.Members.MethodMembers { @@ -23,304 +23,101 @@ public static IPredicate AreVirtual() return new SimplePredicate(member => member.IsVirtual, "are virtual"); } - public static IPredicate AreCalledBy( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return AreCalledBy(types); - } - - public static IPredicate AreCalledBy(Type firstType, params Type[] moreTypes) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return AreCalledBy(types); - } - public static IPredicate AreCalledBy(IObjectProvider objectProvider) { - IEnumerable Condition( - IEnumerable ruleTypes, - Architecture architecture - ) - { - var types = objectProvider.GetObjects(architecture); - return ruleTypes.Where(type => type.GetCallingTypes().Intersect(types).Any()); - } - - var description = "are called by " + objectProvider.Description; - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate AreCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - - IEnumerable Condition(IEnumerable ruleTypes) - { - return ruleTypes.Where(type => type.GetCallingTypes().Intersect(typeList).Any()); - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "are called by one of no types (always false)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "are called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new EnumerablePredicate(Condition, description); - } - - public static IPredicate AreCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - - IEnumerable Condition( + IEnumerable Filter( IEnumerable ruleTypes, Architecture architecture ) { - var archUnitTypeList = new List(); - foreach (var type in typeList) - { - try - { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); - } - catch (TypeDoesNotExistInArchitecture) - { - //ignore, can't have a dependency anyways - } - } - return ruleTypes.Where(type => - type.GetCallingTypes().Intersect(archUnitTypeList).Any() + var isRequiredType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + return ruleTypes.Where(methodMember => + methodMember.GetCallingTypes().Any(isRequiredType) ); } - string description; - if (typeList.IsNullOrEmpty()) - { - description = "are called by one of no types (always false)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "are called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate HaveDependencyInMethodBodyTo( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveDependencyInMethodBodyTo(types); - } - - public static IPredicate HaveDependencyInMethodBodyTo( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveDependencyInMethodBodyTo(types); + var description = objectProvider.FormatDescription( + "are called by one of no types (impossible)", + "are called by", + "are called by any" + ); + return new ArchitecturePredicate(Filter, description); } public static IPredicate HaveDependencyInMethodBodyTo( IObjectProvider objectProvider ) { - IEnumerable Condition( + IEnumerable Filter( IEnumerable ruleTypes, Architecture architecture ) { - var types = objectProvider.GetObjects(architecture); - return ruleTypes.Where(type => - type.GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(types) - .Any() + var isRequiredType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() ); - } - - var description = "have dependencies in method body to " + objectProvider.Description; - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate HaveDependencyInMethodBodyTo( - IEnumerable types - ) - { - var typeList = types.ToList(); - - IEnumerable Condition(IEnumerable ruleTypes) - { - return ruleTypes.Where(type => - type.GetBodyTypeMemberDependencies() + return ruleTypes.Where(methodMember => + methodMember + .GetBodyTypeMemberDependencies() .Select(dependency => dependency.Target) - .Intersect(typeList) - .Any() + .Any(isRequiredType) ); } - string description; - if (typeList.IsNullOrEmpty()) - { - description = "have dependencies in method body to one of no types (always false)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new EnumerablePredicate(Condition, description); + var description = objectProvider.FormatDescription( + "have dependencies in method body to one of no types (impossible)", + "have dependencies in method body to", + "have dependencies in method body to any" + ); + return new ArchitecturePredicate(Filter, description); } - public static IPredicate HaveDependencyInMethodBodyTo(IEnumerable types) + public static IPredicate HaveReturnType(IObjectProvider objectProvider) { - var typeList = types.ToList(); - - IEnumerable Condition( - IEnumerable ruleTypes, + IEnumerable Filter( + IEnumerable methodMembers, Architecture architecture ) { - var archUnitTypeList = new List(); - foreach (var type in typeList) - { - try - { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); - } - catch (TypeDoesNotExistInArchitecture) - { - //ignore, can't have a dependency anyways - } - } - return ruleTypes.Where(type => - type.GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(archUnitTypeList) - .Any() + var isRequiredType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() ); + return methodMembers.Where(methodMember => isRequiredType(methodMember.ReturnType)); } - string description; - if (typeList.IsNullOrEmpty()) - { - description = "have dependencies in method body to one of no types (always false)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate HaveReturnType( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveReturnType(types); + var description = objectProvider.FormatDescription( + "have return type of no types (impossible)", + "have return type", + "have return type" + ); + return new ArchitecturePredicate(Filter, description); } - public static IPredicate HaveReturnType(IEnumerable types) + public static IPredicate HaveReturnType(IEnumerable types) { var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.FullName).ToList(); - var description = - "have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - return new SimplePredicate( - member => typeList.Any(type => member.ReturnType.FullNameEquals(type.FullName)), - description - ); - } - - public static IPredicate HaveReturnType(IObjectProvider types) - { - IEnumerable Condition( + IEnumerable Filter( IEnumerable methodMembers, Architecture architecture ) { - var typeList = types.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - return methodMemberList.Where(methodMember => - typeList.Any(type => methodMember.ReturnType.FullNameEquals(type.FullName)) + return methodMembers.Where(methodMember => + typeList.Any(type => methodMember.ReturnTypeInstance.MatchesType(type)) ); } - var description = "have return type " + types.Description; - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate HaveReturnType( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return HaveReturnType(types); - } - - public static IPredicate HaveReturnType(IEnumerable types) - { - var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.ToString()).ToList(); - var description = - "have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - - return new SimplePredicate( - member => typeList.Any(type => member.ReturnTypeInstance.MatchesType(type)), - description + var typeDescription = string.Join( + " or ", + typeList.Select(type => $"\"{type.FullName}\"") ); + var description = + typeList.Count == 0 + ? "have return type of no types (impossible)" + : $"have return type {typeDescription}"; + return new ArchitecturePredicate(Filter, description); } //Negations @@ -341,312 +138,105 @@ public static IPredicate AreNotVirtual() ); } - public static IPredicate AreNotCalledBy( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return AreNotCalledBy(types); - } - - public static IPredicate AreNotCalledBy( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return AreNotCalledBy(types); - } - public static IPredicate AreNotCalledBy(IObjectProvider objectProvider) { - IEnumerable Condition( - IEnumerable ruleTypes, - Architecture architecture - ) - { - var types = objectProvider.GetObjects(architecture); - return ruleTypes.Where(type => !type.GetCallingTypes().Intersect(types).Any()); - } - - var description = "are not called by " + objectProvider.Description; - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate AreNotCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - - IEnumerable Condition(IEnumerable ruleTypes) - { - return ruleTypes.Where(type => !type.GetCallingTypes().Intersect(typeList).Any()); - } - - string description; - if (typeList.IsNullOrEmpty()) - { - description = "are not called by one of no types (always true)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "are not called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new EnumerablePredicate(Condition, description); - } - - public static IPredicate AreNotCalledBy(IEnumerable types) - { - var typeList = types.ToList(); - - IEnumerable Condition( + IEnumerable Filter( IEnumerable ruleTypes, Architecture architecture ) { - var archUnitTypeList = new List(); - foreach (var type in typeList) - { - try - { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); - } - catch (TypeDoesNotExistInArchitecture) - { - //ignore, can't have a dependency anyways - } - } - return ruleTypes.Where(type => - !type.GetCallingTypes().Intersect(archUnitTypeList).Any() + var isForbiddenType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + return ruleTypes.Where(methodMember => + !methodMember.GetCallingTypes().Any(isForbiddenType) ); } - string description; - if (typeList.IsNullOrEmpty()) - { - description = "are not called by one of no types (always false)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "are not called by \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate DoNotHaveDependencyInMethodBodyTo( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return DoNotHaveDependencyInMethodBodyTo(types); - } - - public static IPredicate DoNotHaveDependencyInMethodBodyTo( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return DoNotHaveDependencyInMethodBodyTo(types); + var description = objectProvider.FormatDescription( + "are not called by one of no types (always true)", + "are not called by", + "are not called by any" + ); + return new ArchitecturePredicate(Filter, description); } public static IPredicate DoNotHaveDependencyInMethodBodyTo( IObjectProvider objectProvider ) { - IEnumerable Condition( + IEnumerable Filter( IEnumerable ruleTypes, Architecture architecture ) { - var types = objectProvider.GetObjects(architecture); - return ruleTypes.Where(type => - !type.GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(types) - .Any() + var isForbiddenType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() ); - } - - var description = - "do not have dependencies in method body to " + objectProvider.Description; - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate DoNotHaveDependencyInMethodBodyTo( - IEnumerable types - ) - { - var typeList = types.ToList(); - - IEnumerable Condition(IEnumerable ruleTypes) - { - return ruleTypes.Where(type => - !type.GetBodyTypeMemberDependencies() + return ruleTypes.Where(methodMember => + !methodMember + .GetBodyTypeMemberDependencies() .Select(dependency => dependency.Target) - .Intersect(typeList) - .Any() + .Any(isForbiddenType) ); } - string description; - if (typeList.IsNullOrEmpty()) - { - description = - "do not have dependencies in method body to one of no types (always true)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => !type.Equals(firstType)) - .Distinct() - .Aggregate( - "do not have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new EnumerablePredicate(Condition, description); + var description = objectProvider.FormatDescription( + "do not have dependencies in method body to one of no types (always true)", + "do not have dependencies in method body to", + "do not have dependencies in method body to any" + ); + return new ArchitecturePredicate(Filter, description); } - public static IPredicate DoNotHaveDependencyInMethodBodyTo( - IEnumerable types + public static IPredicate DoNotHaveReturnType( + IObjectProvider objectProvider ) { - var typeList = types.ToList(); - - IEnumerable Condition( - IEnumerable ruleTypes, + IEnumerable Filter( + IEnumerable methodMembers, Architecture architecture ) { - var archUnitTypeList = new List(); - foreach (var type in typeList) - { - try - { - var archUnitType = architecture.GetITypeOfType(type); - archUnitTypeList.Add(archUnitType); - } - catch (TypeDoesNotExistInArchitecture) - { - //ignore, can't have a dependency anyways - } - } - return ruleTypes.Where(type => - !type.GetBodyTypeMemberDependencies() - .Select(dependency => dependency.Target) - .Intersect(archUnitTypeList) - .Any() + var isForbiddenType = CreateLookupFn( + objectProvider.GetObjects(architecture).ToList() + ); + return methodMembers.Where(methodMember => + !isForbiddenType(methodMember.ReturnType) ); } - string description; - if (typeList.IsNullOrEmpty()) - { - description = - "do not have dependencies in method body to one of no types (always true)"; - } - else - { - var firstType = typeList.First(); - description = typeList - .Where(type => type != firstType) - .Distinct() - .Aggregate( - "do not have dependencies in method body to \"" + firstType.FullName + "\"", - (current, type) => current + " or \"" + type.FullName + "\"" - ); - } - - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate DoNotHaveReturnType( - IType firstType, - params IType[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return DoNotHaveReturnType(types); + var description = objectProvider.FormatDescription( + "do not have return type of no types (always true)", + "do not have return type", + "do not have return type" + ); + return new ArchitecturePredicate(Filter, description); } - public static IPredicate DoNotHaveReturnType(IEnumerable types) + public static IPredicate DoNotHaveReturnType(IEnumerable types) { var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.FullName).ToList(); - var description = - "do not have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - return new SimplePredicate( - member => typeList.Any(type => !member.ReturnType.FullNameEquals(type.FullName)), - description - ); - } - - public static IPredicate DoNotHaveReturnType(IObjectProvider types) - { - IEnumerable Condition( + IEnumerable Filter( IEnumerable methodMembers, Architecture architecture ) { - var typeList = types.GetObjects(architecture).ToList(); - var methodMemberList = methodMembers.ToList(); - return methodMemberList.Where(methodMember => - typeList.All(type => !methodMember.ReturnType.FullNameEquals(type.FullName)) + return methodMembers.Where(methodMember => + typeList.All(type => !methodMember.ReturnTypeInstance.MatchesType(type)) ); } - var description = "do not have return type " + types.Description; - return new ArchitecturePredicate(Condition, description); - } - - public static IPredicate DoNotHaveReturnType( - Type firstType, - params Type[] moreTypes - ) - { - var types = new List { firstType }; - types.AddRange(moreTypes); - return DoNotHaveReturnType(types); - } - - public static IPredicate DoNotHaveReturnType(IEnumerable types) - { - var typeList = types.ToList(); - var typeStringList = typeList.Select(type => type.ToString()).ToList(); - var description = - "do not have return type \"" + string.Join("\" or \"", typeStringList) + "\""; - - return new SimplePredicate( - member => typeList.All(type => !member.ReturnTypeInstance.MatchesType(type)), - description + var typeDescription = string.Join( + " or ", + typeList.Select(type => $"\"{type.FullName}\"") ); + var description = + typeList.Count == 0 + ? "do not have return type of no types (always true)" + : $"do not have return type {typeDescription}"; + return new ArchitecturePredicate(Filter, description); } } } diff --git a/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs b/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs index c65e2e497..cfb0795c0 100644 --- a/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs +++ b/ArchUnitNETTests/AssemblyTestHelper/TypeAssemblyTestHelper.cs @@ -165,6 +165,16 @@ public class TypeAssemblyTestHelper : AssemblyTestHelper public Type ClassWithOtherRegularClassReturnTypeSystemType = typeof(ClassWithOtherRegularClassReturnType); + // Generic return type test classes + public Class GenericClassOneArg; + public Type GenericClassOneArgSystemType = typeof(GenericClass<>); + + public Class GenericClassTwoArg; + public Type GenericClassTwoArgSystemType = typeof(GenericClass<,>); + + public Class ClassWithGenericReturnType; + public Type ClassWithGenericReturnTypeSystemType = typeof(ClassWithGenericReturnType); + // Individual members public IMember StaticField; public IMember NonStaticField; @@ -187,6 +197,9 @@ public class TypeAssemblyTestHelper : AssemblyTestHelper public MethodMember ClassWithNonVirtualMethodConstructor; public MethodMember MethodReturningRegularClass; public MethodMember MethodReturningOtherRegularClass; + public MethodMember MethodReturningGenericClass; + public MethodMember MethodReturningGenericClassWithOtherArg; + public MethodMember MethodReturningTwoArgGenericClass; public TypeAssemblyTestHelper() { @@ -291,6 +304,13 @@ public TypeAssemblyTestHelper() typeof(ClassWithOtherRegularClassReturnType) ); + // Generic return type test classes + GenericClassOneArg = Architecture.GetClassOfType(typeof(GenericClass<>)); + GenericClassTwoArg = Architecture.GetClassOfType(typeof(GenericClass<,>)); + ClassWithGenericReturnType = Architecture.GetClassOfType( + typeof(ClassWithGenericReturnType) + ); + // Method members (MethodMember type) VirtualMethod = ClassWithVirtualMethod.GetMethodMembersWithName("VirtualMethod()").First(); OtherVirtualMethod = OtherClassWithVirtualMethod @@ -317,5 +337,14 @@ public TypeAssemblyTestHelper() MethodReturningOtherRegularClass = ClassWithOtherRegularClassReturnType .GetMethodMembersWithName("MethodReturningOtherRegularClass()") .First(); + MethodReturningGenericClass = ClassWithGenericReturnType + .GetMethodMembersWithName("MethodReturningGenericClass()") + .First(); + MethodReturningGenericClassWithOtherArg = ClassWithGenericReturnType + .GetMethodMembersWithName("MethodReturningGenericClassWithOtherArg()") + .First(); + MethodReturningTwoArgGenericClass = ClassWithGenericReturnType + .GetMethodMembersWithName("MethodReturningTwoArgGenericClass()") + .First(); } } diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/MatchGenericReturnTypesTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/MatchGenericReturnTypesTests.cs deleted file mode 100644 index 84001555c..000000000 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/MatchGenericReturnTypesTests.cs +++ /dev/null @@ -1,218 +0,0 @@ -using ArchUnitNET.Domain; -using ArchUnitNET.Loader; -using ArchUnitNET.xUnit; -using Xunit; -using static ArchUnitNET.Fluent.ArchRuleDefinition; - -namespace ArchUnitNETTests.Fluent.Syntax.Elements -{ - public class MatchGenericReturnTypesTests - { - private static readonly Architecture Architecture = new ArchLoader() - .LoadAssemblies(System.Reflection.Assembly.Load("ArchUnitNETTests")) - .Build(); - - [Fact] - public void OneGenericParameter() - { - MethodMembers() - .That() - .AreDeclaredIn(typeof(OneGenericReturnTypeExample)) - .And() - .HaveName("CorrectGenericArgument()") - .Should() - .Exist() - .AndShould() - .HaveReturnType(typeof(ExampleGenericClass<>)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(OneGenericReturnTypeExample)) - .And() - .HaveName("WrongGenericArgument()") - .Should() - .Exist() - .AndShould() - .HaveReturnType(typeof(ExampleGenericClass<>)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(OneGenericReturnTypeExample)) - .And() - .HaveNameContaining("WrongReturnType") - .Should() - .Exist() - .AndShould() - .NotHaveReturnType(typeof(ExampleGenericClass<>)) - .Check(Architecture); - } - - [Fact] - public void TwoGenericParameters() - { - MethodMembers() - .That() - .AreDeclaredIn(typeof(TwoGenericReturnTypesExample)) - .And() - .HaveName("CorrectGenericArgument()") - .Should() - .Exist() - .AndShould() - .HaveReturnType(typeof(ExampleGenericClass<,>)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(TwoGenericReturnTypesExample)) - .And() - .HaveName("WrongGenericArgument()") - .Should() - .Exist() - .AndShould() - .HaveReturnType(typeof(ExampleGenericClass<,>)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(TwoGenericReturnTypesExample)) - .And() - .HaveNameContaining("WrongReturnType") - .Should() - .Exist() - .AndShould() - .NotHaveReturnType(typeof(ExampleGenericClass<,>)) - .Check(Architecture); - } - - [Fact] - public void OneGenericArgument() - { - MethodMembers() - .That() - .AreDeclaredIn(typeof(OneGenericReturnTypeExample)) - .And() - .HaveName("CorrectGenericArgument()") - .Should() - .Exist() - .AndShould() - .HaveReturnType(typeof(ExampleGenericClass)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(OneGenericReturnTypeExample)) - .And() - .HaveName("WrongGenericArgument()") - .Should() - .Exist() - .AndShould() - .NotHaveReturnType(typeof(ExampleGenericClass)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(OneGenericReturnTypeExample)) - .And() - .HaveNameContaining("WrongReturnType") - .Should() - .Exist() - .AndShould() - .NotHaveReturnType(typeof(ExampleGenericClass)) - .Check(Architecture); - } - - [Fact] - public void TwoGenericArguments() - { - MethodMembers() - .That() - .AreDeclaredIn(typeof(TwoGenericReturnTypesExample)) - .And() - .HaveName("CorrectGenericArgument()") - .Should() - .Exist() - .AndShould() - .HaveReturnType(typeof(ExampleGenericClass)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(TwoGenericReturnTypesExample)) - .And() - .HaveName("WrongGenericArgument()") - .Should() - .Exist() - .AndShould() - .NotHaveReturnType(typeof(ExampleGenericClass)) - .Check(Architecture); - MethodMembers() - .That() - .AreDeclaredIn(typeof(TwoGenericReturnTypesExample)) - .And() - .HaveNameContaining("WrongReturnType") - .Should() - .Exist() - .AndShould() - .NotHaveReturnType(typeof(ExampleGenericClass)) - .Check(Architecture); - } - } - - // ReSharper disable All - class ExampleGenericClass { } - - class ExampleGenericClass { } - - class ExampleArgument { } - - class OneGenericReturnTypeExample - { - public ExampleGenericClass CorrectGenericArgument() - { - return new ExampleGenericClass(); - } - - public ExampleGenericClass WrongGenericArgument() - { - return new ExampleGenericClass(); - } - - public ExampleGenericClass WrongReturnType1() - { - return new ExampleGenericClass(); - } - - public void WrongReturnType2() - { - return; - } - - public bool WrongReturnType3() - { - return true; - } - } - - class TwoGenericReturnTypesExample - { - public ExampleGenericClass CorrectGenericArgument() - { - return new ExampleGenericClass(); - } - - public ExampleGenericClass WrongGenericArgument() - { - return new ExampleGenericClass(); - } - - public ExampleGenericClass WrongReturnType1() - { - return new ExampleGenericClass(); - } - - public void WrongReturnType2() - { - return; - } - - public bool WrongReturnType3() - { - return true; - } - } -} diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs index 05372ba90..f4f9aea04 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs @@ -2,7 +2,9 @@ using System.Collections.Generic; using System.Threading.Tasks; using ArchUnitNET.Domain; +using ArchUnitNET.Domain.Exceptions; using ArchUnitNETTests.AssemblyTestHelper; +using TypeNamespace; using Xunit; using static ArchUnitNET.Fluent.ArchRuleDefinition; @@ -189,10 +191,8 @@ public async Task BeCalledByTest() should = MethodMembers().That().Are(helper.CalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - // TODO: Empty IEnumerable/ crashes with InvalidOperationException - // (.First() on empty list) — uncomment when AssertException supports lazy evaluation - // should.BeCalledBy(new List()).AssertException(helper); - // should.BeCalledBy(new List()).AssertException(helper); + should.BeCalledBy(new List()).AssertOnlyViolations(helper); + should.BeCalledBy(new List()).AssertOnlyViolations(helper); helper.AddSnapshotSubHeader("Predicates"); should.Be(MethodMembers().That().AreCalledBy(new List())).AssertOnlyViolations(helper); @@ -202,10 +202,10 @@ public async Task BeCalledByTest() should = MethodMembers().That().Are(helper.CalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - should.BeCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertOnlyViolations(helper); + should.BeCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertException(helper); helper.AddSnapshotSubHeader("Predicates"); - should.Be(MethodMembers().That().AreCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().AreCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertException(helper); helper.AddSnapshotHeader("Multiple inputs"); MethodMembers().That().Are(helper.CalledMethod, helper.CalledMethod1).Should().BeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); @@ -272,10 +272,8 @@ public async Task NotBeCalledByTest() should = MethodMembers().That().Are(helper.CalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - // TODO: Empty IEnumerable/ crashes with InvalidOperationException - // (.First() on empty list) — uncomment when AssertException supports lazy evaluation - // should.NotBeCalledBy(new List()).AssertException(helper); - // should.NotBeCalledBy(new List()).AssertException(helper); + should.NotBeCalledBy(new List()).AssertNoViolations(helper); + should.NotBeCalledBy(new List()).AssertNoViolations(helper); helper.AddSnapshotSubHeader("Predicates"); should.Be(MethodMembers().That().AreNotCalledBy(new List())).AssertNoViolations(helper); @@ -285,10 +283,10 @@ public async Task NotBeCalledByTest() should = MethodMembers().That().Are(helper.CalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - should.NotBeCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertNoViolations(helper); + should.NotBeCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertException(helper); helper.AddSnapshotSubHeader("Predicates"); - should.Be(MethodMembers().That().AreNotCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertNoViolations(helper); + should.Be(MethodMembers().That().AreNotCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertException(helper); helper.AddSnapshotHeader("Multiple inputs"); MethodMembers().That().Are(helper.MethodWithoutDependencies, helper.MethodCallingCalledMethod).Should().NotBeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); @@ -355,10 +353,8 @@ public async Task HaveDependencyInMethodBodyToTest() should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - // TODO: Empty IEnumerable/ crashes with InvalidOperationException - // (.First() on empty list) — uncomment when AssertException supports lazy evaluation - // should.HaveDependencyInMethodBodyTo(new List()).AssertException(helper); - // should.HaveDependencyInMethodBodyTo(new List()).AssertException(helper); + should.HaveDependencyInMethodBodyTo(new List()).AssertOnlyViolations(helper); + should.HaveDependencyInMethodBodyTo(new List()).AssertOnlyViolations(helper); helper.AddSnapshotSubHeader("Predicates"); should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List())).AssertOnlyViolations(helper); @@ -368,10 +364,10 @@ public async Task HaveDependencyInMethodBodyToTest() should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - should.HaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertOnlyViolations(helper); + should.HaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertException(helper); helper.AddSnapshotSubHeader("Predicates"); - should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertException(helper); helper.AddSnapshotHeader("Multiple inputs"); MethodMembers().That().Are(helper.MethodCallingCalledMethod, helper.AnotherMethodCallingCalledMethod).Should().HaveDependencyInMethodBodyTo(helper.MethodDependencyClass).AssertNoViolations(helper); @@ -438,10 +434,8 @@ public async Task NotHaveDependencyInMethodBodyToTest() should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - // TODO: Empty IEnumerable/ crashes with InvalidOperationException - // (.First() on empty list) — uncomment when AssertException supports lazy evaluation - // should.NotHaveDependencyInMethodBodyTo(new List()).AssertException(helper); - // should.NotHaveDependencyInMethodBodyTo(new List()).AssertException(helper); + should.NotHaveDependencyInMethodBodyTo(new List()).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List()).AssertNoViolations(helper); helper.AddSnapshotSubHeader("Predicates"); should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List())).AssertNoViolations(helper); @@ -451,10 +445,10 @@ public async Task NotHaveDependencyInMethodBodyToTest() should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); helper.AddSnapshotSubHeader("Conditions"); - should.NotHaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertNoViolations(helper); + should.NotHaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) }).AssertException(helper); helper.AddSnapshotSubHeader("Predicates"); - should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveDependencyInMethodBodyTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertException(helper); helper.AddSnapshotHeader("Multiple inputs"); MethodMembers().That().Are(helper.MethodWithoutDependencies, helper.CalledMethod).Should().NotHaveDependencyInMethodBodyTo(helper.OtherCallingClass).AssertNoViolations(helper); @@ -521,6 +515,48 @@ public async Task HaveReturnTypeTest() MethodMembers().That().Are(helper.MethodReturningRegularClass, helper.MethodReturningOtherRegularClass).Should().HaveReturnType(helper.RegularClass).AssertAnyViolations(helper); MethodMembers().That().Are(helper.MethodReturningRegularClass, helper.MethodReturningOtherRegularClass).Should().HaveReturnType(helper.RegularClass, helper.OtherRegularClass).AssertNoViolations(helper); + helper.AddSnapshotHeader("Open generic System.Type matches closed generic IType"); + should = MethodMembers().That().Are(helper.MethodReturningGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(typeof(GenericClass<>)).AssertNoViolations(helper); + should.HaveReturnType(new List { typeof(GenericClass<>) }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(typeof(GenericClass<>))).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { typeof(GenericClass<>) })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Specific closed generic System.Type matches exact return type"); + should = MethodMembers().That().Are(helper.MethodReturningGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(typeof(GenericClass)).AssertNoViolations(helper); + should.HaveReturnType(new List { typeof(GenericClass) }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(typeof(GenericClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { typeof(GenericClass) })).AssertNoViolations(helper); + + helper.AddSnapshotHeader("Specific closed generic System.Type rejects wrong generic argument"); + should = MethodMembers().That().Are(helper.MethodReturningGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(typeof(GenericClass)).AssertOnlyViolations(helper); + should.HaveReturnType(new List { typeof(GenericClass) }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(typeof(GenericClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().HaveReturnType(new List { typeof(GenericClass) })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Two-arg open generic System.Type matches two-arg closed generic"); + should = MethodMembers().That().Are(helper.MethodReturningTwoArgGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.HaveReturnType(typeof(GenericClass<,>)).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().HaveReturnType(typeof(GenericClass<,>))).AssertNoViolations(helper); + await helper.AssertSnapshotMatches(); } @@ -566,26 +602,54 @@ public async Task DoNotHaveReturnTypeTest() helper.AddSnapshotHeader("Multiple arguments"); should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); - // NotHaveReturnType(IEnumerable) condition uses .All(type => !match) — fails if ANY type matches - // With {OtherRegularClass, RegularClass}: OtherRegularClass doesn't match (true) AND RegularClass matches (false) => All = false => violation helper.AddSnapshotSubHeader("Conditions"); should.NotHaveReturnType(helper.OtherRegularClass, helper.RegularClass).AssertOnlyViolations(helper); should.NotHaveReturnType(new List { helper.OtherRegularClass, helper.RegularClass }).AssertOnlyViolations(helper); should.NotHaveReturnType(helper.OtherRegularClassSystemType, helper.RegularClassSystemType).AssertOnlyViolations(helper); should.NotHaveReturnType(new List { helper.OtherRegularClassSystemType, helper.RegularClassSystemType }).AssertOnlyViolations(helper); - // DoNotHaveReturnType predicate uses .Any(type => !match) for IEnumerable — passes if ANY type doesn't match - // With {OtherRegularClass, RegularClass}: OtherRegularClass doesn't match (true) => Any = true => passes - // BUT: IEnumerable and IObjectProvider overloads use .All(type => !match) — fails if ANY type matches helper.AddSnapshotSubHeader("Predicates"); - should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClass, helper.RegularClass)).AssertNoViolations(helper); - should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClass, helper.RegularClass })).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClass, helper.RegularClass)).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClass, helper.RegularClass })).AssertOnlyViolations(helper); should.Be(MethodMembers().That().DoNotHaveReturnType(helper.OtherRegularClassSystemType, helper.RegularClassSystemType)).AssertOnlyViolations(helper); should.Be(MethodMembers().That().DoNotHaveReturnType(new List { helper.OtherRegularClassSystemType, helper.RegularClassSystemType })).AssertOnlyViolations(helper); helper.AddSnapshotHeader("Multiple inputs"); MethodMembers().That().Are(helper.MethodReturningRegularClass, helper.MethodReturningOtherRegularClass).Should().NotHaveReturnType(helper.RegularClass).AssertAnyViolations(helper); + helper.AddSnapshotHeader("Open generic System.Type matches closed generic for negation"); + should = MethodMembers().That().Are(helper.MethodReturningGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveReturnType(typeof(GenericClass<>)).AssertOnlyViolations(helper); + should.NotHaveReturnType(new List { typeof(GenericClass<>) }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveReturnType(typeof(GenericClass<>))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { typeof(GenericClass<>) })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Specific closed generic System.Type for negation"); + should = MethodMembers().That().Are(helper.MethodReturningGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveReturnType(typeof(GenericClass)).AssertOnlyViolations(helper); + should.NotHaveReturnType(new List { typeof(GenericClass) }).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveReturnType(typeof(GenericClass))).AssertOnlyViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { typeof(GenericClass) })).AssertOnlyViolations(helper); + + helper.AddSnapshotHeader("Wrong closed generic System.Type is not a violation for negation"); + should = MethodMembers().That().Are(helper.MethodReturningGenericClass).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.NotHaveReturnType(typeof(GenericClass)).AssertNoViolations(helper); + should.NotHaveReturnType(new List { typeof(GenericClass) }).AssertNoViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); + should.Be(MethodMembers().That().DoNotHaveReturnType(typeof(GenericClass))).AssertNoViolations(helper); + should.Be(MethodMembers().That().DoNotHaveReturnType(new List { typeof(GenericClass) })).AssertNoViolations(helper); + await helper.AssertSnapshotMatches(); } diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt index 1f4f27eb7..ead6cda0b 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt @@ -14,7 +14,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Called Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: @@ -46,7 +46,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Called Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: @@ -86,11 +86,11 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: False Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" @@ -133,12 +133,12 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" @@ -164,25 +164,25 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: @@ -190,25 +190,25 @@ All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: @@ -218,23 +218,41 @@ All Evaluations passed ----- Conditions ----- +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by + + + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) +Result: False +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by +Message: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by + + + ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false) +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false) +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (always false)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (always false) +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) @@ -243,24 +261,12 @@ Message: ----- Conditions ----- Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "AttributeNamespace.ClassWithoutAttributes" -Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by "AttributeNamespace.ClassWithoutAttributes" -Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "AttributeNamespace.ClassWithoutAttributes"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by "AttributeNamespace.ClassWithoutAttributes" - - +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "AttributeNamespace.ClassWithoutAttributes" -Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by "AttributeNamespace.ClassWithoutAttributes" -Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "AttributeNamespace.ClassWithoutAttributes"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by "AttributeNamespace.ClassWithoutAttributes" - - +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt index 976c4d30d..78c02b29d 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt @@ -10,10 +10,10 @@ All Evaluations passed Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" +Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.GenericClass`1::.ctor()" or "System.Void TypeNamespace.GenericClass`2::.ctor()" or "System.Void TypeNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" Message: "Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" + System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.GenericClass`1::.ctor()" or "System.Void TypeNamespace.GenericClass`2::.ctor()" or "System.Void TypeNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt index 016269181..0d4b152f8 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt @@ -203,16 +203,22 @@ Message: ----- Predicates ----- Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" -Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" Message: -All Evaluations passed +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" + + Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" -Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Result: False +Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" Message: -All Evaluations passed +"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: + TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" + + Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" Result: False @@ -245,3 +251,117 @@ Message: +===== Open generic System.Type matches closed generic for negation ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + + + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + + + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1" +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" + + + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1" +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" + + + +===== Specific closed generic System.Type for negation ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + + + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + + + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... + + + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... + + + +===== Wrong closed generic System.Type is not a violation for negation ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Cultu... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Cultu... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt index 1c255b1fd..bbb07a82e 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt @@ -14,7 +14,7 @@ Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCall Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: @@ -46,7 +46,7 @@ Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCall Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: @@ -86,11 +86,11 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" Result: False Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" @@ -133,12 +133,12 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" @@ -164,25 +164,25 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: @@ -190,25 +190,25 @@ All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCal... +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... Result: True Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: @@ -218,23 +218,41 @@ All Evaluations passed ----- Conditions ----- +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to + + + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) +Result: False +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to +Message: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to + + + ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false) +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false) +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (always false)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (always false) +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) @@ -243,24 +261,12 @@ Message: ----- Conditions ----- Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" -Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" -Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" - - +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" -Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" -Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" - - +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt index 3f12ef4d5..7805af951 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt @@ -235,3 +235,123 @@ Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegular Message: All Evaluations passed +===== Open generic System.Type matches closed generic IType ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1" +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1" +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +===== Specific closed generic System.Type matches exact return type ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, ... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, ... +Result: True +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Message: +All Evaluations passed + +===== Specific closed generic System.Type rejects wrong generic argument ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + + + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + + + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... + + + +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut... +Result: False +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Message: +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut..." failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... + + + +===== Two-arg open generic System.Type matches two-arg closed generic ===== + +----- Conditions ----- + +Query: Method members that are "TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodRetur... should have return type "TypeNamespace.GenericClass`2" +Result: True +Description: TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodReturningTwoArgGenericClass() passed +Message: +All Evaluations passed + +----- Predicates ----- + +Query: Method members that are "TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodRetur... should be Method members that have return type "TypeNamespace.GenericClass`2" +Result: True +Description: TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodReturningTwoArgGenericClass() passed +Message: +All Evaluations passed + diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt index e53178654..019dc5223 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt @@ -14,7 +14,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Method Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -46,7 +46,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Method Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -86,11 +86,11 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: False Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodDependencyNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodDependencyNamespace.MethodDependencyClass" @@ -133,12 +133,12 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" @@ -164,25 +164,25 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -190,25 +190,25 @@ All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -218,6 +218,18 @@ All Evaluations passed ----- Conditions ----- +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Message: +All Evaluations passed + ----- Predicates ----- Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) @@ -226,7 +238,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Called Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always false) +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed Message: @@ -237,18 +249,12 @@ All Evaluations passed ----- Conditions ----- Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "AttributeNamespace.ClassWithoutAttributes" -Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed -Message: -All Evaluations passed +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "AttributeNamespace.ClassWithoutAttributes" -Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed -Message: -All Evaluations passed +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt index 4662d45ec..5e54f3abc 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt @@ -14,7 +14,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Method Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -46,7 +46,7 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Method Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -86,11 +86,11 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: False Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" @@ -133,12 +133,12 @@ Message: -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" @@ -164,25 +164,25 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -190,25 +190,25 @@ All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.O... +Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... Result: True Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: @@ -218,6 +218,18 @@ All Evaluations passed ----- Conditions ----- +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + +Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to one of no types (always true) +Result: True +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Message: +All Evaluations passed + ----- Predicates ----- Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) @@ -237,18 +249,12 @@ All Evaluations passed ----- Conditions ----- Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" -Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed -Message: -All Evaluations passed +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" -Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed -Message: -All Evaluations passed +Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== diff --git a/TestAssemblies/TypeAssembly/Type.cs b/TestAssemblies/TypeAssembly/Type.cs index 6a0955d07..128716184 100644 --- a/TestAssemblies/TypeAssembly/Type.cs +++ b/TestAssemblies/TypeAssembly/Type.cs @@ -200,3 +200,26 @@ public OtherRegularClass MethodReturningOtherRegularClass() return new OtherRegularClass(); } } + +// Generic return type test classes +public class GenericClass { } + +public class GenericClass { } + +public class ClassWithGenericReturnType +{ + public GenericClass MethodReturningGenericClass() + { + return new GenericClass(); + } + + public GenericClass MethodReturningGenericClassWithOtherArg() + { + return new GenericClass(); + } + + public GenericClass MethodReturningTwoArgGenericClass() + { + return new GenericClass(); + } +} From aee6b87999995287bfbef2b812229660b38d9eef Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Fri, 24 Jul 2026 15:16:04 +0200 Subject: [PATCH 3/6] fix: description formatting for empty inputs Signed-off-by: Alexander Linne --- .../MethodMemberConditionsDefinition.cs | 23 ++++++++++++++---- .../Types/TypeConditionsDefinition.cs | 12 ++++++++-- ...xElementsTests.BeCalledByTest.verified.txt | 8 +++---- ...eDependencyInMethodBodyToTest.verified.txt | 8 +++---- ...mentsTests.BeAssignableToTest.verified.txt | 24 ++++++++++++++++++- .../Elements/TypeSyntaxElementsTests.cs | 8 ++++++- 6 files changed, 66 insertions(+), 17 deletions(-) diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs index 08d8325cc..7acbf2987 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs @@ -41,6 +41,7 @@ public static IOrderedCondition BeCalledBy( IObjectProvider objectProvider ) { + var sizedObjectProvider = objectProvider as ISizedObjectProvider; IEnumerable Condition( IEnumerable methodMembers, Architecture architecture @@ -60,7 +61,9 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "is not called by " + objectProvider.Description + (sizedObjectProvider != null && sizedObjectProvider.Count == 0) + ? "is not called by one of no types (impossible)" + : "is not called by " + objectProvider.Description ); } } @@ -78,6 +81,7 @@ public static IOrderedCondition HaveDependencyInMethodBodyTo( IObjectProvider objectProvider ) { + var sizedObjectProvider = objectProvider as ISizedObjectProvider; IEnumerable Condition( IEnumerable methodMembers, Architecture architecture @@ -102,8 +106,10 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "does not have dependencies in method body to " - + objectProvider.Description + (sizedObjectProvider != null && sizedObjectProvider.Count == 0) + ? "does not have dependencies in method body to one of no types (impossible)" + : "does not have dependencies in method body to " + + objectProvider.Description ); } } @@ -215,6 +221,7 @@ public static IOrderedCondition NotBeCalledBy( IObjectProvider objectProvider ) { + var sizedObjectProvider = objectProvider as ISizedObjectProvider; IEnumerable Condition( IEnumerable methodMembers, Architecture architecture @@ -234,7 +241,9 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "is called by " + objectProvider.Description + (sizedObjectProvider != null && sizedObjectProvider.Count == 0) + ? "is called by one of no types (always true)" + : "is called by " + objectProvider.Description ); } } @@ -252,6 +261,7 @@ public static IOrderedCondition NotHaveDependencyInMethodBodyTo( IObjectProvider objectProvider ) { + var sizedObjectProvider = objectProvider as ISizedObjectProvider; IEnumerable Condition( IEnumerable methodMembers, Architecture architecture @@ -276,7 +286,10 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "does have dependencies in method body to " + objectProvider.Description + (sizedObjectProvider != null && sizedObjectProvider.Count == 0) + ? "does have dependencies in method body to one of no types (always true)" + : "does have dependencies in method body to " + + objectProvider.Description ); } } diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Types/TypeConditionsDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Types/TypeConditionsDefinition.cs index 93c536596..c8a5a16fc 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Types/TypeConditionsDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Types/TypeConditionsDefinition.cs @@ -61,6 +61,7 @@ public static IOrderedCondition BeAssignableTo( IObjectProvider objectProvider ) { + var sizedObjectProvider = objectProvider as ISizedObjectProvider; IEnumerable Condition( IEnumerable ruleTypes, Architecture architecture @@ -69,7 +70,10 @@ Architecture architecture var isExpectedType = CreateLookupFn( objectProvider.GetObjects(architecture).ToList() ); - var failDescription = "is not assignable to " + objectProvider.Description; + var failDescription = + (sizedObjectProvider != null && sizedObjectProvider.Count == 0) + ? "is not assignable to no types (always false)" + : "is not assignable to " + objectProvider.Description; foreach (var ruleType in ruleTypes) { if (ruleType.GetAssignableTypes().Any(isExpectedType)) @@ -503,6 +507,7 @@ public static IOrderedCondition NotBeAssignableTo( IObjectProvider objectProvider ) { + var sizedObjectProvider = objectProvider as ISizedObjectProvider; IEnumerable Condition( IEnumerable ruleTypes, Architecture architecture @@ -511,7 +516,10 @@ Architecture architecture var isForbiddenType = CreateLookupFn( objectProvider.GetObjects(architecture).ToList() ); - var failDescription = "is assignable to " + objectProvider.Description; + var failDescription = + (sizedObjectProvider != null && sizedObjectProvider.Count == 0) + ? "is assignable to no types (always true)" + : "is assignable to " + objectProvider.Description; foreach (var ruleType in ruleTypes) { if (ruleType.GetAssignableTypes().Any(isForbiddenType)) diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt index ead6cda0b..e001254d4 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt @@ -220,19 +220,19 @@ All Evaluations passed Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) Message: "Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by +Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) Message: "Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by + System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt index bbb07a82e..124729d92 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt @@ -220,19 +220,19 @@ All Evaluations passed Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) Message: "Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to +Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) Message: "Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to + System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/TypeSyntaxElementsTests.BeAssignableToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/TypeSyntaxElementsTests.BeAssignableToTest.verified.txt index 3b40cb3ba..a7b6acdd6 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/TypeSyntaxElementsTests.BeAssignableToTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/TypeSyntaxElementsTests.BeAssignableToTest.verified.txt @@ -319,7 +319,29 @@ Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in prov Query: Types that are "TypeNamespace.BaseClassForAssign" should be Types that are assignable to "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. -===== Empty Arguments (Predicates only) ===== +===== Empty Arguments ===== + +----- Conditions ----- + +Query: Types that are "TypeNamespace.BaseClassForAssign" should be assignable to no types (always false) +Result: False +Description: TypeNamespace.BaseClassForAssign is not assignable to no types (always false) +Message: +"Types that are "TypeNamespace.BaseClassForAssign" should be assignable to no types (always false)" failed: + TypeNamespace.BaseClassForAssign is not assignable to no types (always false) + + + +Query: Types that are "TypeNamespace.BaseClassForAssign" should be assignable to no types (always false) +Result: False +Description: TypeNamespace.BaseClassForAssign is not assignable to no types (always false) +Message: +"Types that are "TypeNamespace.BaseClassForAssign" should be assignable to no types (always false)" failed: + TypeNamespace.BaseClassForAssign is not assignable to no types (always false) + + + +----- Predicates ----- Query: Types that are "TypeNamespace.BaseClassForAssign" should be Types that are assignable to no types (always false) Result: False diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs index a7563eec6..76b7d6512 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs @@ -226,8 +226,14 @@ public async Task BeAssignableToTest() helper.AddSnapshotSubHeader("Predicates"); should.Be(Types().That().AreAssignableTo(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertException(helper); - helper.AddSnapshotHeader("Empty Arguments (Predicates only)"); + helper.AddSnapshotHeader("Empty Arguments"); should = Types().That().Are(helper.BaseClassForAssign).Should(); + + helper.AddSnapshotSubHeader("Conditions"); + should.BeAssignableTo(new List()).AssertOnlyViolations(helper); + should.BeAssignableTo(new List()).AssertOnlyViolations(helper); + + helper.AddSnapshotSubHeader("Predicates"); should.Be(Types().That().AreAssignableTo(new List())).AssertOnlyViolations(helper); should.Be(Types().That().AreAssignableTo(new List())).AssertOnlyViolations(helper); From 541d9d54cc06458d5cc4c103e81b7363f1c08f96 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Fri, 24 Jul 2026 15:45:58 +0200 Subject: [PATCH 4/6] fix: formatting of generic types Signed-off-by: Alexander Linne --- .../Domain/Extensions/TypeExtensions.cs | 43 +++++++++++++++++++ .../MethodMemberConditionsDefinition.cs | 28 +++++++++--- ...Tests.DoNotHaveReturnTypeTest.verified.txt | 28 ++++++------ ...mentsTests.HaveReturnTypeTest.verified.txt | 20 ++++----- 4 files changed, 89 insertions(+), 30 deletions(-) diff --git a/ArchUnitNET/Domain/Extensions/TypeExtensions.cs b/ArchUnitNET/Domain/Extensions/TypeExtensions.cs index a3779b0a6..a5b13f9e4 100644 --- a/ArchUnitNET/Domain/Extensions/TypeExtensions.cs +++ b/ArchUnitNET/Domain/Extensions/TypeExtensions.cs @@ -334,6 +334,49 @@ public static IEnumerable GetInheritsBaseClassDepen : type.Dependencies.OfType(); } + public static string GetFullNameForErrorMessage(this IType type, Architecture architecture) + { + var isAmbiguous = architecture.Types.Count(t => t.FullName == type.FullName) > 1; + return isAmbiguous + ? type.FullName + " (" + type.Assembly.FullName + ")" + : type.FullName; + } + + public static string GetFullNameForErrorMessage( + this ITypeInstance typeInstance, + Architecture architecture + ) + { + var fullName = typeInstance.Type.GetFullNameForErrorMessage(architecture); + var genericArguments = typeInstance.GenericArguments.ToList(); + return genericArguments.Count == 0 + ? fullName + : fullName + + "<" + + string.Join( + ",", + genericArguments.Select(argument => + argument.GetFullNameForErrorMessage(architecture) + ) + ) + + ">"; + } + + public static string GetFullNameForDescription(this Type type) + { + var fullName = type.Namespace + "." + type.Name; + if (!type.IsConstructedGenericType) + { + return fullName; + } + + var argumentsDescription = string.Join( + ",", + type.GetGenericArguments().Select(GetFullNameForDescription) + ); + return fullName + "<" + argumentsDescription + ">"; + } + public static bool MatchesType(this ITypeInstance typeInstance, Type targetType) { var targetTypeFullNameWithoutAssembly = targetType.Namespace + "." + targetType.Name; diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs index 7acbf2987..790fe309f 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs @@ -146,7 +146,11 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" + methodMember.ReturnType.FullName + "\"" + "has return type \"" + + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( + architecture + ) + + "\"" ); } } @@ -180,7 +184,11 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" + methodMember.ReturnType.FullName + "\"" + "has return type \"" + + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( + architecture + ) + + "\"" ); } } @@ -188,7 +196,7 @@ Architecture architecture var typeDescription = string.Join( " or ", - typeList.Select(type => $"\"{type.FullName}\"") + typeList.Select(type => $"\"{type.GetFullNameForDescription()}\"") ); var description = typeList.Count == 0 @@ -326,7 +334,11 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" + methodMember.ReturnType.FullName + "\"" + "has return type \"" + + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( + architecture + ) + + "\"" ); } } @@ -360,7 +372,11 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" + methodMember.ReturnType.FullName + "\"" + "has return type \"" + + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( + architecture + ) + + "\"" ); } } @@ -368,7 +384,7 @@ Architecture architecture var typeDescription = string.Join( " or ", - typeList.Select(type => $"\"{type.FullName}\"") + typeList.Select(type => $"\"{type.GetFullNameForDescription()}\"") ); var description = typeList.Count == 0 diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt index 0d4b152f8..4813729b6 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt @@ -257,19 +257,19 @@ Message: Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Message: "Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Message: "Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" @@ -297,21 +297,21 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015f..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" @@ -339,13 +339,13 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" Result: True Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" Result: True Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt index 7805af951..9f03a46b1 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt @@ -269,13 +269,13 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" Result: True Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" Result: True Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: @@ -299,21 +299,21 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1"" failed: + TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" From 972f44b9dd164d25bada787e9e9d4079084b0781 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Fri, 14 Aug 2026 09:53:39 +0200 Subject: [PATCH 5/6] chore: use separte test assembly for method member syntax elements tests Signed-off-by: Alexander Linne --- ArchUnit.sln | 15 + ArchUnitNETTests/ArchUnitNETTests.csproj | 1 + .../MethodMemberAssemblyTestHelper.cs | 118 ++++++++ .../MethodMemberSyntaxElementsTests.cs | 26 +- ...xElementsTests.BeCalledByTest.verified.txt | 204 ++++++------- ...ementsTests.BeConstructorTest.verified.txt | 40 +-- ...Tests.BeMethodMembersThatTest.verified.txt | 12 +- ...entsTests.BeNoConstructorTest.verified.txt | 40 +-- ...axElementsTests.BeVirtualTest.verified.txt | 40 +-- ...Tests.DoNotHaveReturnTypeTest.verified.txt | 274 +++++++++--------- ...eDependencyInMethodBodyToTest.verified.txt | 204 ++++++------- ...mentsTests.HaveReturnTypeTest.verified.txt | 240 +++++++-------- ...ementsTests.NotBeCalledByTest.verified.txt | 188 ++++++------ ...lementsTests.NotBeVirtualTest.verified.txt | 40 +-- ...eDependencyInMethodBodyToTest.verified.txt | 188 ++++++------ ArchUnitNETTests/StaticTestArchitectures.cs | 6 + .../MethodMemberAssembly.csproj | 12 + .../MethodMemberAssemblyClasses.cs | 95 ++++++ 18 files changed, 995 insertions(+), 748 deletions(-) create mode 100644 ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs create mode 100644 TestAssemblies/MethodMemberAssembly/MethodMemberAssembly.csproj create mode 100644 TestAssemblies/MethodMemberAssembly/MethodMemberAssemblyClasses.cs diff --git a/ArchUnit.sln b/ArchUnit.sln index 65c417234..682cbca93 100644 --- a/ArchUnit.sln +++ b/ArchUnit.sln @@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchUnitNET.MSTestV4", "Arc EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TypeAssembly", "TestAssemblies\TypeAssembly\TypeAssembly.csproj", "{ABCA0EC3-E47E-453E-B4CC-3446ED4F7643}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MethodMemberAssembly", "TestAssemblies\MethodMemberAssembly\MethodMemberAssembly.csproj", "{05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -379,6 +381,18 @@ Global {ABCA0EC3-E47E-453E-B4CC-3446ED4F7643}.Release|x64.Build.0 = Release|Any CPU {ABCA0EC3-E47E-453E-B4CC-3446ED4F7643}.Release|x86.ActiveCfg = Release|Any CPU {ABCA0EC3-E47E-453E-B4CC-3446ED4F7643}.Release|x86.Build.0 = Release|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Debug|x64.ActiveCfg = Debug|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Debug|x64.Build.0 = Debug|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Debug|x86.ActiveCfg = Debug|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Debug|x86.Build.0 = Debug|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Release|Any CPU.Build.0 = Release|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Release|x64.ActiveCfg = Release|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Release|x64.Build.0 = Release|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Release|x86.ActiveCfg = Release|Any CPU + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -393,5 +407,6 @@ Global {E6CB8C69-25F5-4C94-8EA3-D56E444EB46B} = {B1191F18-91CB-4387-B775-A5EB64D3AC30} {AA695589-8CCC-4474-9A7F-01A6376C375A} = {B1191F18-91CB-4387-B775-A5EB64D3AC30} {ABCA0EC3-E47E-453E-B4CC-3446ED4F7643} = {B1191F18-91CB-4387-B775-A5EB64D3AC30} + {05F40E4D-94EC-4DF7-B0FA-1BCBFDF56088} = {B1191F18-91CB-4387-B775-A5EB64D3AC30} EndGlobalSection EndGlobal diff --git a/ArchUnitNETTests/ArchUnitNETTests.csproj b/ArchUnitNETTests/ArchUnitNETTests.csproj index 631aec75e..36c160fc9 100644 --- a/ArchUnitNETTests/ArchUnitNETTests.csproj +++ b/ArchUnitNETTests/ArchUnitNETTests.csproj @@ -32,6 +32,7 @@ /> + diff --git a/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs b/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs new file mode 100644 index 000000000..3455e1d3f --- /dev/null +++ b/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs @@ -0,0 +1,118 @@ +using System; +using System.Linq; +using ArchUnitNET.Domain; +using ArchUnitNET.Domain.Extensions; +using MethodMemberNamespace; + +namespace ArchUnitNETTests.AssemblyTestHelper; + +public class MethodMemberAssemblyTestHelper : AssemblyTestHelper +{ + public sealed override Architecture Architecture => + StaticTestArchitectures.MethodMemberArchitecture; + + public Class RegularClass; + public Type RegularClassSystemType = typeof(RegularClass); + + public Class OtherRegularClass; + public Type OtherRegularClassSystemType = typeof(OtherRegularClass); + + public Class ClassWithVirtualMethod; + public Class OtherClassWithVirtualMethod; + public Class ClassWithNonVirtualMethod; + public Class ClassWithStringReturnType; + public Class ClassWithRegularClassReturnType; + public Class ClassWithOtherRegularClassReturnType; + public Class ClassWithGenericReturnType; + + public MethodMember VirtualMethod; + public MethodMember OtherVirtualMethod; + public MethodMember NonVirtualMethod; + public MethodMember ClassWithVirtualMethodConstructor; + public MethodMember ClassWithNonVirtualMethodConstructor; + public MethodMember MethodReturningString; + public MethodMember MethodReturningRegularClass; + public MethodMember MethodReturningOtherRegularClass; + public MethodMember MethodReturningGenericClass; + public MethodMember MethodReturningTwoArgGenericClass; + + public Class MethodDependencyClass; + public Type MethodDependencyClassSystemType = typeof(MethodDependencyClass); + + public Class OtherCallingClass; + public Type OtherCallingClassSystemType = typeof(OtherCallingClass); + + public MethodMember CalledMethod; + public MethodMember OtherCalledMethod; + public MethodMember MethodWithoutDependencies; + public MethodMember MethodCallingCalledMethod; + public MethodMember AnotherMethodCallingCalledMethod; + + public MethodMemberAssemblyTestHelper() + { + RegularClass = Architecture.GetClassOfType(typeof(RegularClass)); + OtherRegularClass = Architecture.GetClassOfType(typeof(OtherRegularClass)); + + ClassWithVirtualMethod = Architecture.GetClassOfType(typeof(ClassWithVirtualMethod)); + OtherClassWithVirtualMethod = Architecture.GetClassOfType( + typeof(OtherClassWithVirtualMethod) + ); + ClassWithNonVirtualMethod = Architecture.GetClassOfType(typeof(ClassWithNonVirtualMethod)); + ClassWithStringReturnType = Architecture.GetClassOfType(typeof(ClassWithStringReturnType)); + ClassWithRegularClassReturnType = Architecture.GetClassOfType( + typeof(ClassWithRegularClassReturnType) + ); + ClassWithOtherRegularClassReturnType = Architecture.GetClassOfType( + typeof(ClassWithOtherRegularClassReturnType) + ); + ClassWithGenericReturnType = Architecture.GetClassOfType( + typeof(ClassWithGenericReturnType) + ); + + VirtualMethod = ClassWithVirtualMethod.GetMethodMembersWithName("VirtualMethod()").First(); + OtherVirtualMethod = OtherClassWithVirtualMethod + .GetMethodMembersWithName("OtherVirtualMethod()") + .First(); + NonVirtualMethod = ClassWithNonVirtualMethod + .GetMethodMembersWithName("NonVirtualMethod()") + .First(); + ClassWithVirtualMethodConstructor = ClassWithVirtualMethod + .GetMethodMembersWithName(".ctor()") + .First(); + ClassWithNonVirtualMethodConstructor = ClassWithNonVirtualMethod + .GetMethodMembersWithName(".ctor()") + .First(); + MethodReturningString = ClassWithStringReturnType + .GetMethodMembersWithName("MethodReturningString()") + .First(); + MethodReturningRegularClass = ClassWithRegularClassReturnType + .GetMethodMembersWithName("MethodReturningRegularClass()") + .First(); + MethodReturningOtherRegularClass = ClassWithOtherRegularClassReturnType + .GetMethodMembersWithName("MethodReturningOtherRegularClass()") + .First(); + MethodReturningGenericClass = ClassWithGenericReturnType + .GetMethodMembersWithName("MethodReturningGenericClass()") + .First(); + MethodReturningTwoArgGenericClass = ClassWithGenericReturnType + .GetMethodMembersWithName("MethodReturningTwoArgGenericClass()") + .First(); + + MethodDependencyClass = Architecture.GetClassOfType(typeof(MethodDependencyClass)); + OtherCallingClass = Architecture.GetClassOfType(typeof(OtherCallingClass)); + + CalledMethod = MethodDependencyClass.GetMethodMembersWithName("CalledMethod()").First(); + OtherCalledMethod = MethodDependencyClass + .GetMethodMembersWithName("OtherCalledMethod()") + .First(); + MethodWithoutDependencies = MethodDependencyClass + .GetMethodMembersWithName("MethodWithoutDependencies()") + .First(); + MethodCallingCalledMethod = OtherCallingClass + .GetMethodMembersWithName("MethodCallingCalledMethod()") + .First(); + AnotherMethodCallingCalledMethod = OtherCallingClass + .GetMethodMembersWithName("AnotherMethodCallingCalledMethod()") + .First(); + } +} diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs index f4f9aea04..9dcfe998b 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs @@ -4,7 +4,7 @@ using ArchUnitNET.Domain; using ArchUnitNET.Domain.Exceptions; using ArchUnitNETTests.AssemblyTestHelper; -using TypeNamespace; +using MethodMemberNamespace; using Xunit; using static ArchUnitNET.Fluent.ArchRuleDefinition; @@ -16,7 +16,7 @@ public class MethodMemberSyntaxElementsTests [Fact] public async Task BeConstructorTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor).Should(); @@ -46,7 +46,7 @@ public async Task BeConstructorTest() [Fact] public async Task BeNoConstructorTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.VirtualMethod).Should(); @@ -76,7 +76,7 @@ public async Task BeNoConstructorTest() [Fact] public async Task BeVirtualTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.VirtualMethod).Should(); @@ -106,7 +106,7 @@ public async Task BeVirtualTest() [Fact] public async Task NotBeVirtualTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.NonVirtualMethod).Should(); @@ -136,7 +136,7 @@ public async Task NotBeVirtualTest() [Fact] public async Task BeCalledByTest() { - var helper = new MethodDependencyAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.CalledMethod).Should(); @@ -208,7 +208,7 @@ public async Task BeCalledByTest() should.Be(MethodMembers().That().AreCalledBy(new List { typeof(AttributeNamespace.ClassWithoutAttributes) })).AssertException(helper); helper.AddSnapshotHeader("Multiple inputs"); - MethodMembers().That().Are(helper.CalledMethod, helper.CalledMethod1).Should().BeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); + MethodMembers().That().Are(helper.CalledMethod, helper.OtherCalledMethod).Should().BeCalledBy(helper.MethodDependencyClass).AssertNoViolations(helper); MethodMembers().That().Are(helper.CalledMethod, helper.MethodWithoutDependencies).Should().BeCalledBy(helper.MethodDependencyClass).AssertAnyViolations(helper); await helper.AssertSnapshotMatches(); @@ -217,7 +217,7 @@ public async Task BeCalledByTest() [Fact] public async Task NotBeCalledByTest() { - var helper = new MethodDependencyAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); @@ -298,7 +298,7 @@ public async Task NotBeCalledByTest() [Fact] public async Task HaveDependencyInMethodBodyToTest() { - var helper = new MethodDependencyAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.MethodCallingCalledMethod).Should(); @@ -379,7 +379,7 @@ public async Task HaveDependencyInMethodBodyToTest() [Fact] public async Task NotHaveDependencyInMethodBodyToTest() { - var helper = new MethodDependencyAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.MethodWithoutDependencies).Should(); @@ -460,7 +460,7 @@ public async Task NotHaveDependencyInMethodBodyToTest() [Fact] public async Task HaveReturnTypeTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); @@ -563,7 +563,7 @@ public async Task HaveReturnTypeTest() [Fact] public async Task DoNotHaveReturnTypeTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); var should = MethodMembers().That().Are(helper.MethodReturningRegularClass).Should(); @@ -656,7 +656,7 @@ public async Task DoNotHaveReturnTypeTest() [Fact] public async Task BeMethodMembersThatTest() { - var helper = new TypeAssemblyTestHelper(); + var helper = new MethodMemberAssemblyTestHelper(); helper.AddSnapshotHeader("No Violations"); MethodMembers().That().Are(helper.ClassWithVirtualMethodConstructor).Should().BeMethodMembersThat().AreConstructors().AssertNoViolations(helper); diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt index e001254d4..f2f06c33c 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeCalledByTest.verified.txt @@ -2,65 +2,65 @@ ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed @@ -68,95 +68,95 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by any Types that are "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by Types that are "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by any Types that are "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by any Types that are "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that are called by "MethodMemberNamespace.MethodDependencyClass" @@ -164,53 +164,53 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed @@ -218,41 +218,41 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by one of no types (impossible)" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not called by one of no types (impossible) ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible)" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by one of no types (impossible)" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are called by one of no types (impossible) @@ -260,32 +260,32 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be called by "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be called by "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are called by "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass::OtherCal... should be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod1() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::OtherCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWi... should be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWi... should be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not called by "MethodMemberNamespace.MethodDependencyClass" diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt index 313caba6f..04fca7dbd 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeConstructorTest.verified.txt @@ -2,17 +2,17 @@ ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be a constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be a constructor Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are constructors +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are constructors Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() passed Message: All Evaluations passed @@ -20,44 +20,44 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are constructors +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are constructors Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are constructors +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are constructors Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are constructors" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are constructors +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are constructors" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are constructors ===== Multiple inputs ===== -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" should be a constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" should be a constructor Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() passed Result: True -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor() passed +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor() passed Message: All Evaluations passed -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() passed Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be a constructor" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is no constructor diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt index 78c02b29d..1464a84e8 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt @@ -1,19 +1,19 @@ ===== No Violations ===== -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be method members that are constructors +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be method members that are constructors Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() passed Message: All Evaluations passed ===== Violations ===== -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.GenericClass`1::.ctor()" or "System.Void TypeNamespace.GenericClass`2::.ctor()" or "System.Void TypeNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void MethodMemberNamespace.RegularClass::.ctor()" or "System.Void MethodMemberNamespace.OtherRegularClass::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithStringReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`1::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`2::.ctor()" or "System.Void MethodMemberNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void MethodMemberNamespace.MethodDependencyClass::.ctor()" or "System.Void MethodMemberNamespace.OtherCallingClass::.ctor()" Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void TypeNamespace.RegularClass::.ctor()" or "System.Void TypeNamespace.OtherRegularClass::.ctor()" or "System.Void TypeNamespace.ClassWithProperty::.ctor()" or "System.Void TypeNamespace.ClassWithField::.ctor()" or "System.Void TypeNamespace.ClassWithMethod::.ctor()" or "System.Void TypeNamespace.ClassWithAllMembers::.ctor()" or "System.Void TypeNamespace.ClassWithoutMembers::.ctor()" or "System.Void TypeNamespace.OuterClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB::.ctor()" or "System.Void TypeNamespace.NonNestedClass::.ctor()" or "System.Void TypeNamespace.ClassImplementingInterface::.ctor()" or "System.Void TypeNamespace.ClassNotImplementingInterface::.ctor()" or "System.Void TypeNamespace.BaseClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherBaseClassForAssign::.ctor()" or "System.Void TypeNamespace.DerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherDerivedClassForAssign::.ctor()" or "System.Void TypeNamespace.UnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.OtherUnrelatedClassForAssign::.ctor()" or "System.Void TypeNamespace.ClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithNonStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithReadOnlyField::.ctor()" or "System.Void TypeNamespace.ClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithWritableProperty::.ctor()" or "System.Void TypeNamespace.ClassWithInitOnlyProperty::.ctor()" or "System.Void TypeNamespace.ClassWithGetOnlyProperty::.ctor()" or "System.Void TypeNamespace.OtherClassWithStaticField::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.ctor()" or "System.Void TypeNamespace.ClassWithStaticProperty::.cctor()" or "System.Void TypeNamespace.ClassWithStaticMethod::.ctor()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void TypeNamespace.ClassWithStringReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithIntReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void TypeNamespace.GenericClass`1::.ctor()" or "System.Void TypeNamespace.GenericClass`2::.ctor()" or "System.Void TypeNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void TypeNamespace.OuterClassA/InnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassA/OtherInnerClassA::.ctor()" or "System.Void TypeNamespace.OuterClassB/InnerClassB::.ctor()" +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void MethodMemberNamespace.RegularClass::.ctor()" or "System.Void MethodMemberNamespace.OtherRegularClass::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithStringReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`1::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`2::.ctor()" or "System.Void MethodMemberNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void MethodMemberNamespace.MethodDependencyClass::.ctor()" or "System.Void MethodMemberNamespace.OtherCallingClass::.ctor()" diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt index dc0d56fd0..d5dda8470 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeNoConstructorTest.verified.txt @@ -2,17 +2,17 @@ ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be no constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be no constructor Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are no constructors +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are no constructors Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Message: All Evaluations passed @@ -20,44 +20,44 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() is a constructor Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() is a constructor ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are no constructors +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are no constructors Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is not Method members that are no constructors +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() is not Method members that are no constructors Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are no constructors" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is not Method members that are no constructors +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be Method members that are no constructors" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() is not Method members that are no constructors ===== Multiple inputs ===== -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be no constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::No... should be no constructor Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Result: True -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() is a constructor Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::.ctor() is a constructor +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" should be no constructor" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor() is a constructor diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt index 479afa235..664cc8019 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeVirtualTest.verified.txt @@ -2,17 +2,17 @@ ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be virtual Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are virtual Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Message: All Evaluations passed @@ -20,44 +20,44 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual Result: False -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual Message: -"Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual" failed: - System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual +"Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual" failed: + System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are virtual Result: False -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not Method members that are virtual +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not Method members that are virtual Message: -"Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are virtual" failed: - System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not Method members that are virtual +"Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are virtual" failed: + System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not Method members that are virtual ===== Multiple inputs ===== -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.OtherClassWithVirtualMethod::OtherVirtualMeth... should be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::... should be virtual Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Result: True -Description: System.Void TypeNamespace.OtherClassWithVirtualMethod::OtherVirtualMethod() passed +Description: System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::OtherVirtualMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::No... should be virtual Result: True -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() passed Result: False -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be virtual" failed: - System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::No... should be virtual" failed: + System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() is not virtual diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt index 4813729b6..4212c9f88 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.DoNotHaveReturnTypeTest.verified.txt @@ -2,65 +2,65 @@ ----- Conditions ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed @@ -68,95 +68,95 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type Types that are "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" ----- Predicates ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type Types that are "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type Types that are "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type Types that are "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type Types that are "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type Types that are "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.RegularClass" @@ -164,90 +164,90 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" ----- Predicates ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "TypeNamespace.OtherRegularClass" or "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that do not have return type "MethodMemberNamespace.OtherRegularClass" or "MethodMemberNamespace.RegularClass" ===== Multiple inputs ===== -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should not have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "MethodMemberNames... should not have return type "MethodMemberNamespace.RegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() passed +Description: MethodMemberNamespace.OtherRegularClass MethodMemberNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() passed Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should not have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "MethodMemberNames... should not have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" @@ -255,41 +255,41 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1" -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1" @@ -297,41 +297,41 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Ver... Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=n... Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Ver..." failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=n... -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Ver... Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=n... Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=ne..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0... +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Ver..." failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=n... @@ -339,29 +339,29 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should not have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should not have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Cultu... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly... Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that do not have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Cultu... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that do not have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly... Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt index 124729d92..b5d28f807 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveDependencyInMethodBodyToTest.verified.txt @@ -2,65 +2,65 @@ ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed @@ -68,95 +68,95 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to Types that are "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() is not Method members that have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" @@ -164,53 +164,53 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCalling... Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCalling... Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCalling... Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.Othe... +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCalling... Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed @@ -218,41 +218,41 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does not have dependencies in method body to one of no types (impossible) ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible) Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible)" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to one of no types (impossible)" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that have dependencies in method body to one of no types (impossible) @@ -260,32 +260,32 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.OtherCallingCl... should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodMemberNamespace.OtherCallingClass::Ano... should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::AnotherMethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::AnotherMethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass:... should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass:... should have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() does not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt index 9f03a46b1..6023e6b09 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeTest.verified.txt @@ -2,65 +2,65 @@ ----- Conditions ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed @@ -68,95 +68,95 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type Types that are "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "TypeNamespace.RegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() has return type "MethodMemberNamespace.RegularClass" ----- Predicates ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type Types that are "TypeNamespace.OtherRegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type Types that are "MethodMemberNamespace.OtherRegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type Types that are "TypeNamespace.OtherRegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type Types that are "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type Types that are "MethodMemberNamespace.OtherRegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass" Result: False -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.OtherRegularClass"" failed: - TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "TypeNamespace.OtherRegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.OtherRegularClass"" failed: + MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() is not Method members that have return type "MethodMemberNamespace.OtherRegularClass" @@ -164,74 +164,74 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" should be Method members that have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Message: All Evaluations passed ===== Multiple inputs ===== -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should have return type "TypeNamespace.RegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "MethodMemberNames... should have return type "MethodMemberNamespace.RegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Result: False -Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() has return type "TypeNamespace.OtherRegularClass" +Description: MethodMemberNamespace.OtherRegularClass MethodMemberNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() has return type "MethodMemberNamespace.OtherRegularClass" Message: -"Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should have return type "TypeNamespace.RegularClass"" failed: - TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() has return type "TypeNamespace.OtherRegularClass" +"Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "MethodMemberNames... should have return type "MethodMemberNamespace.RegularClass"" failed: + MethodMemberNamespace.OtherRegularClass MethodMemberNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() has return type "MethodMemberNamespace.OtherRegularClass" -Query: Method members that are "TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "TypeNamespace.OtherRegularClass T... should have return type "TypeNamespace.RegularClass" or "TypeNamespace.OtherRegularClass" +Query: Method members that are "MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass()" or "MethodMemberNames... should have return type "MethodMemberNamespace.RegularClass" or "MethodMemberNamespace.OtherRegularClass" Result: True -Description: TypeNamespace.RegularClass TypeNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed +Description: MethodMemberNamespace.RegularClass MethodMemberNamespace.ClassWithRegularClassReturnType::MethodReturningRegularClass() passed Result: True -Description: TypeNamespace.OtherRegularClass TypeNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() passed +Description: MethodMemberNamespace.OtherRegularClass MethodMemberNamespace.ClassWithOtherRegularClassReturnType::MethodReturningOtherRegularClass() passed Message: All Evaluations passed @@ -239,29 +239,29 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed @@ -269,29 +269,29 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1" Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, ... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Version=1.... Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.RegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, ... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.RegularClass, MethodMemberAssembly, Version=1.... Result: True -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() passed Message: All Evaluations passed @@ -299,41 +299,41 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1" +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1" Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should have return type "TypeNamespace.GenericClass`1"" failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "TypeNamespace.GenericClass`1" +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should have return type "MethodMemberNamespace.GenericClass`1"" failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() has return type "MethodMemberNamespace.GenericClass`1" ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Versi... Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=neu... Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Versi..." failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=neu... -Query: Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut... +Query: Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Versi... Result: False -Description: TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +Description: MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=neu... Message: -"Method members that are "TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass()" should be Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neut..." failed: - TypeNamespace.GenericClass`1 TypeNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "TypeNamespace.GenericClass`1[[TypeNamespace.OtherRegularClass, TypeAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015... +"Method members that are "MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGene... should be Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Versi..." failed: + MethodMemberNamespace.GenericClass`1 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningGenericClass() is not Method members that have return type "MethodMemberNamespace.GenericClass`1[[MethodMemberNamespace.OtherRegularClass, MethodMemberAssembly, Version=1.0.0.0, Culture=neu... @@ -341,17 +341,17 @@ Message: ----- Conditions ----- -Query: Method members that are "TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodRetur... should have return type "TypeNamespace.GenericClass`2" +Query: Method members that are "MethodMemberNamespace.GenericClass`2 MethodMemberNamespace.ClassWi... should have return type "MethodMemberNamespace.GenericClass`2" Result: True -Description: TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodReturningTwoArgGenericClass() passed +Description: MethodMemberNamespace.GenericClass`2 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningTwoArgGenericClass() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodRetur... should be Method members that have return type "TypeNamespace.GenericClass`2" +Query: Method members that are "MethodMemberNamespace.GenericClass`2 MethodMemberNamespace.ClassWi... should be Method members that have return type "MethodMemberNamespace.GenericClass`2" Result: True -Description: TypeNamespace.GenericClass`2 TypeNamespace.ClassWithGenericReturnType::MethodReturningTwoArgGenericClass() passed +Description: MethodMemberNamespace.GenericClass`2 MethodMemberNamespace.ClassWithGenericReturnType::MethodReturningTwoArgGenericClass() passed Message: All Evaluations passed diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt index 019dc5223..80a3af717 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeCalledByTest.verified.txt @@ -2,65 +2,65 @@ ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed @@ -68,95 +68,95 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by any Types that are "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by Types that are "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by any Types that are "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by any Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by any Types that are "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by any Types that are "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is not Method members that are not called by "MethodMemberNamespace.MethodDependencyClass" @@ -164,53 +164,53 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not be called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that are not called by any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed @@ -218,29 +218,29 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Message: All Evaluations passed @@ -248,32 +248,32 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should not be called by "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should not be called by "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" should be Method members that are not called by "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" or "System.Void MethodDependencyNamespace.OtherCalli... should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" or "System.Void MethodMemberNamespace.OtherCallingClass:... should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should not be called by "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWi... should not be called by "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: -"Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependencyClass::... should not be called by "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() is called by "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWi... should not be called by "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() is called by "MethodMemberNamespace.MethodDependencyClass" diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt index dfb2195a4..fcd102afd 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotBeVirtualTest.verified.txt @@ -2,17 +2,17 @@ ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should not be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should not be virtual Result: True -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are not virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" should be Method members that are not virtual Result: True -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed Message: All Evaluations passed @@ -20,44 +20,44 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual ----- Predicates ----- -Query: Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are not virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are not virtual Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are not virtual +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are not virtual Message: -"Method members that are "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are not virtual" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are not virtual +"Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be Method members that are not virtual" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not Method members that are not virtual ===== Multiple inputs ===== -Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.String TypeNamespace.ClassWithStringReturnType::MethodRetu... should not be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.String MethodMemberNamespace.ClassWithStringReturn... should not be virtual Result: True -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed Result: True -Description: System.String TypeNamespace.ClassWithStringReturnType::MethodReturningString() passed +Description: System.String MethodMemberNamespace.ClassWithStringReturnType::MethodReturningString() passed Message: All Evaluations passed -Query: Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual +Query: Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod:... should not be virtual Result: False -Description: System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual Result: True -Description: System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed +Description: System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod() passed Message: -"Method members that are "System.Void TypeNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod()" should not be virtual" failed: - System.Void TypeNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual +"Method members that are "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::NonVirtualMethod()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod:... should not be virtual" failed: + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is virtual diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt index 5e54f3abc..5474eadb5 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.NotHaveDependencyInMethodBodyToTest.verified.txt @@ -2,65 +2,65 @@ ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any Types that are "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed @@ -68,95 +68,95 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to Types that are "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to any Types that are "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to any Types that are "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() is not Method members that do not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" @@ -164,53 +164,53 @@ Message: ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.Other... Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.Other... Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.Other... Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodDependencyNamespace.MethodDependencyClass" or "MethodDependencyNamespa... +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" should be Method members that do not have dependencies in method body to any "MethodMemberNamespace.MethodDependencyClass" or "MethodMemberNamespace.Other... Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed @@ -218,29 +218,29 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to one of no types (always true) Result: True -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() passed +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() passed Message: All Evaluations passed @@ -248,32 +248,32 @@ All Evaluations passed ----- Conditions ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ----- Predicates ----- -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" should be Method members that do not have dependencies in method body to "AttributeNamespace.ClassWithoutAttributes" Exception: Type AttributeNamespace.ClassWithoutAttributes does not exist in provided architecture or is no class. ===== Multiple inputs ===== -Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies()" or "System.Void MethodDependencyNamespace.MethodDepe... should not have dependencies in method body to "MethodDependencyNamespace.OtherCallingClass" +Query: Method members that are "System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies()" or "System.Void MethodMemberNamespace.MethodDependencyCl... should not have dependencies in method body to "MethodMemberNamespace.OtherCallingClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::CalledMethod() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::CalledMethod() passed Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Message: All Evaluations passed -Query: Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Query: Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass:... should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Result: True -Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithoutDependencies() passed +Description: System.Void MethodMemberNamespace.MethodDependencyClass::MethodWithoutDependencies() passed Result: False -Description: System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +Description: System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" Message: -"Method members that are "System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodDependencyNamespace.MethodDependen... should not have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass"" failed: - System.Void MethodDependencyNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodDependencyNamespace.MethodDependencyClass" +"Method members that are "System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod()" or "System.Void MethodMemberNamespace.MethodDependencyClass:... should not have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass"" failed: + System.Void MethodMemberNamespace.OtherCallingClass::MethodCallingCalledMethod() does have dependencies in method body to "MethodMemberNamespace.MethodDependencyClass" diff --git a/ArchUnitNETTests/StaticTestArchitectures.cs b/ArchUnitNETTests/StaticTestArchitectures.cs index f05c652ef..53f40be8b 100644 --- a/ArchUnitNETTests/StaticTestArchitectures.cs +++ b/ArchUnitNETTests/StaticTestArchitectures.cs @@ -59,6 +59,12 @@ public static class StaticTestArchitectures .LoadAssemblies(typeof(TypeNamespace.RegularClass).Assembly) .Build(); + public static readonly Architecture MethodMemberArchitecture = new ArchLoader() + .WithoutRuleEvaluationCache() + .WithoutArchitectureCache() + .LoadAssemblies(typeof(MethodMemberNamespace.RegularClass).Assembly) + .Build(); + public static readonly Architecture ArchUnitNETTestAssemblyArchitecture = new ArchLoader() .LoadAssemblies(typeof(Class1).Assembly) .Build(); diff --git a/TestAssemblies/MethodMemberAssembly/MethodMemberAssembly.csproj b/TestAssemblies/MethodMemberAssembly/MethodMemberAssembly.csproj new file mode 100644 index 000000000..6865534e9 --- /dev/null +++ b/TestAssemblies/MethodMemberAssembly/MethodMemberAssembly.csproj @@ -0,0 +1,12 @@ + + + net10.0 + enable + enable + true + false + True + ..\..\strongNameKey.snk + 1.0.0.0 + + diff --git a/TestAssemblies/MethodMemberAssembly/MethodMemberAssemblyClasses.cs b/TestAssemblies/MethodMemberAssembly/MethodMemberAssemblyClasses.cs new file mode 100644 index 000000000..c3500ab7e --- /dev/null +++ b/TestAssemblies/MethodMemberAssembly/MethodMemberAssemblyClasses.cs @@ -0,0 +1,95 @@ +namespace MethodMemberNamespace; + +public class RegularClass { } + +public class OtherRegularClass { } + +public class ClassWithVirtualMethod +{ + public virtual void VirtualMethod() { } +} + +public class OtherClassWithVirtualMethod +{ + public virtual void OtherVirtualMethod() { } +} + +public class ClassWithNonVirtualMethod +{ + public void NonVirtualMethod() { } +} + +public class ClassWithStringReturnType +{ + public string MethodReturningString() + { + return ""; + } +} + +public class ClassWithRegularClassReturnType +{ + public RegularClass MethodReturningRegularClass() + { + return new RegularClass(); + } +} + +public class ClassWithOtherRegularClassReturnType +{ + public OtherRegularClass MethodReturningOtherRegularClass() + { + return new OtherRegularClass(); + } +} + +public class GenericClass { } + +public class GenericClass { } + +public class ClassWithGenericReturnType +{ + public GenericClass MethodReturningGenericClass() + { + return new GenericClass(); + } + + public GenericClass MethodReturningTwoArgGenericClass() + { + return new GenericClass(); + } +} + +public class MethodDependencyClass +{ + public void MethodWithSingleDependency() + { + CalledMethod(); + } + + public void CalledMethod() { } + + public void OtherMethodWithSingleDependency() + { + OtherCalledMethod(); + } + + public void OtherCalledMethod() { } + + public void MethodWithoutDependencies() { } +} + +public class OtherCallingClass +{ + public void MethodCallingCalledMethod() + { + var dep = new MethodDependencyClass(); + dep.CalledMethod(); + } + + public void AnotherMethodCallingCalledMethod() + { + var dep = new MethodDependencyClass(); + dep.OtherCalledMethod(); + } +} From ce0550c9ea15ef8e52eb915c3a01adc16af27327 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Fri, 14 Aug 2026 11:35:37 +0200 Subject: [PATCH 6/6] test: duplicate full name disambiguation Signed-off-by: Alexander Linne --- ArchUnit.sln | 4 +- .../Domain/Extensions/TypeExtensions.cs | 10 +++-- .../MethodMemberConditionsDefinition.cs | 38 ++++++++-------- ArchUnitNETTests/ArchUnitNETTests.csproj | 8 ++-- .../MethodMemberAssemblyTestHelper.cs | 12 +++++ .../Domain/Extensions/TypeExtensionTests.cs | 45 +++++++++++++++++++ .../MethodMemberSyntaxElementsTests.cs | 16 +++++++ ...Tests.BeMethodMembersThatTest.verified.txt | 4 +- ...peWithAmbiguousReturnTypeTest.verified.txt | 20 +++++++++ ArchUnitNETTests/Loader/ArchLoaderTests.cs | 28 ++++++++---- ArchUnitNETTests/StaticTestArchitectures.cs | 10 +++-- .../ClassWithAmbiguousReturnType.cs | 9 ++++ .../DuplicateClassAcrossAssemblies.cs | 0 .../DuplicateFullNameAssembly.cs} | 4 +- .../DuplicateFullNameAssembly.csproj} | 0 .../DuplicateClassAcrossAssemblies.cs | 0 .../OtherDuplicateFullNameAssembly.cs | 3 ++ .../OtherDuplicateFullNameAssembly.csproj} | 0 .../OtherLoaderTestAssembly.cs | 3 -- 19 files changed, 167 insertions(+), 47 deletions(-) create mode 100644 ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeWithAmbiguousReturnTypeTest.verified.txt create mode 100644 TestAssemblies/DuplicateFullNameAssembly/ClassWithAmbiguousReturnType.cs rename TestAssemblies/{LoaderTestAssembly => DuplicateFullNameAssembly}/DuplicateClassAcrossAssemblies.cs (100%) rename TestAssemblies/{LoaderTestAssembly/LoaderTestAssembly.cs => DuplicateFullNameAssembly/DuplicateFullNameAssembly.cs} (83%) rename TestAssemblies/{LoaderTestAssembly/LoaderTestAssembly.csproj => DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj} (100%) rename TestAssemblies/{OtherLoaderTestAssembly => OtherDuplicateFullNameAssembly}/DuplicateClassAcrossAssemblies.cs (100%) create mode 100644 TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.cs rename TestAssemblies/{OtherLoaderTestAssembly/OtherLoaderTestAssembly.csproj => OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj} (100%) delete mode 100644 TestAssemblies/OtherLoaderTestAssembly/OtherLoaderTestAssembly.cs diff --git a/ArchUnit.sln b/ArchUnit.sln index 682cbca93..a9a94a8db 100644 --- a/ArchUnit.sln +++ b/ArchUnit.sln @@ -31,9 +31,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AttributeAssembly", "TestAs EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisibilityAssembly", "TestAssemblies\VisibilityAssembly\VisibilityAssembly.csproj", "{FBCD91F2-4DB9-44AC-8214-6F2FFF9178D5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoaderTestAssembly", "TestAssemblies\LoaderTestAssembly\LoaderTestAssembly.csproj", "{0243F2D4-AC89-4561-A936-D647B6BB821F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DuplicateFullNameAssembly", "TestAssemblies\DuplicateFullNameAssembly\DuplicateFullNameAssembly.csproj", "{0243F2D4-AC89-4561-A936-D647B6BB821F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OtherLoaderTestAssembly", "TestAssemblies\OtherLoaderTestAssembly\OtherLoaderTestAssembly.csproj", "{5A24529B-1794-4080-ADCC-77440BA0A0B3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OtherDuplicateFullNameAssembly", "TestAssemblies\OtherDuplicateFullNameAssembly\OtherDuplicateFullNameAssembly.csproj", "{5A24529B-1794-4080-ADCC-77440BA0A0B3}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FilteredDirectoryLoaderTestAssembly", "TestAssemblies\FilteredDirectoryLoaderTestAssembly\FilteredDirectoryLoaderTestAssembly.csproj", "{E6CB8C69-25F5-4C94-8EA3-D56E444EB46B}" EndProject diff --git a/ArchUnitNET/Domain/Extensions/TypeExtensions.cs b/ArchUnitNET/Domain/Extensions/TypeExtensions.cs index a5b13f9e4..c542a2dd1 100644 --- a/ArchUnitNET/Domain/Extensions/TypeExtensions.cs +++ b/ArchUnitNET/Domain/Extensions/TypeExtensions.cs @@ -334,11 +334,15 @@ public static IEnumerable GetInheritsBaseClassDepen : type.Dependencies.OfType(); } + public static bool HasAmbiguousFullName(this IType type, Architecture architecture) + { + return architecture.Types.Count(t => t.FullName == type.FullName) > 1; + } + public static string GetFullNameForErrorMessage(this IType type, Architecture architecture) { - var isAmbiguous = architecture.Types.Count(t => t.FullName == type.FullName) > 1; - return isAmbiguous - ? type.FullName + " (" + type.Assembly.FullName + ")" + return type.HasAmbiguousFullName(architecture) + ? type.FullName + ", " + type.Assembly.FullName : type.FullName; } diff --git a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs index 790fe309f..c42adde78 100644 --- a/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs +++ b/ArchUnitNET/Fluent/Syntax/Elements/Members/MethodMembers/MethodMemberConditionsDefinition.cs @@ -146,11 +146,7 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" - + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( - architecture - ) - + "\"" + BuildReturnTypeFailDescription(methodMember, architecture) ); } } @@ -184,11 +180,7 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" - + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( - architecture - ) - + "\"" + BuildReturnTypeFailDescription(methodMember, architecture) ); } } @@ -334,11 +326,7 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" - + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( - architecture - ) - + "\"" + BuildReturnTypeFailDescription(methodMember, architecture) ); } } @@ -372,11 +360,7 @@ Architecture architecture yield return new ConditionResult( methodMember, false, - "has return type \"" - + methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( - architecture - ) - + "\"" + BuildReturnTypeFailDescription(methodMember, architecture) ); } } @@ -392,5 +376,19 @@ Architecture architecture : $"not have return type {typeDescription}"; return new OrderedArchitectureCondition(Condition, description); } + + private static string BuildReturnTypeFailDescription( + MethodMember methodMember, + Architecture architecture + ) + { + var returnTypeName = methodMember.ReturnTypeInstance.GetFullNameForErrorMessage( + architecture + ); + var ambiguityNote = methodMember.ReturnType.HasAmbiguousFullName(architecture) + ? " (the return type's full name is ambiguous in this architecture; its assembly is shown to disambiguate it)" + : ""; + return "has return type \"" + returnTypeName + "\"" + ambiguityNote; + } } } diff --git a/ArchUnitNETTests/ArchUnitNETTests.csproj b/ArchUnitNETTests/ArchUnitNETTests.csproj index 36c160fc9..0ced15201 100644 --- a/ArchUnitNETTests/ArchUnitNETTests.csproj +++ b/ArchUnitNETTests/ArchUnitNETTests.csproj @@ -23,12 +23,12 @@ ReferenceOutputAssembly="false" /> diff --git a/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs b/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs index 3455e1d3f..b4dbb9e73 100644 --- a/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs +++ b/ArchUnitNETTests/AssemblyTestHelper/MethodMemberAssemblyTestHelper.cs @@ -36,6 +36,10 @@ public class MethodMemberAssemblyTestHelper : AssemblyTestHelper public MethodMember MethodReturningGenericClass; public MethodMember MethodReturningTwoArgGenericClass; + public Class ClassWithAmbiguousReturnType; + public MethodMember MethodWithAmbiguousReturnType; + public IType AmbiguousReturnType; + public Class MethodDependencyClass; public Type MethodDependencyClassSystemType = typeof(MethodDependencyClass); @@ -98,6 +102,14 @@ public MethodMemberAssemblyTestHelper() .GetMethodMembersWithName("MethodReturningTwoArgGenericClass()") .First(); + ClassWithAmbiguousReturnType = Architecture.GetClassOfType( + typeof(DuplicateFullNameAssembly.ClassWithAmbiguousReturnType) + ); + MethodWithAmbiguousReturnType = ClassWithAmbiguousReturnType + .GetMethodMembersWithName("MethodWithAmbiguousReturnType()") + .First(); + AmbiguousReturnType = MethodWithAmbiguousReturnType.ReturnType; + MethodDependencyClass = Architecture.GetClassOfType(typeof(MethodDependencyClass)); OtherCallingClass = Architecture.GetClassOfType(typeof(OtherCallingClass)); diff --git a/ArchUnitNETTests/Domain/Extensions/TypeExtensionTests.cs b/ArchUnitNETTests/Domain/Extensions/TypeExtensionTests.cs index e7386e52c..8747990a9 100644 --- a/ArchUnitNETTests/Domain/Extensions/TypeExtensionTests.cs +++ b/ArchUnitNETTests/Domain/Extensions/TypeExtensionTests.cs @@ -1,3 +1,6 @@ +extern alias DuplicateFullNameAssemblyAlias; +extern alias OtherDuplicateFullNameAssemblyAlias; + using System; using System.Linq; using ArchUnitNET.Domain; @@ -8,6 +11,9 @@ using ArchUnitNETTests.Loader; using Xunit; +using DuplicateClass = DuplicateFullNameAssemblyAlias::DuplicateClassAcrossAssemblies.DuplicateClass; +using OtherDuplicateClass = OtherDuplicateFullNameAssemblyAlias::DuplicateClassAcrossAssemblies.DuplicateClass; + namespace ArchUnitNETTests.Domain.Extensions { public class TypeExtensionTests @@ -83,6 +89,45 @@ public void FullNameEqualsTest() Assert.False(_exampleAttribute.FullNameEquals(null)); } + [Fact] + public void GetFullNameForErrorMessageTest() + { + Assert.Equal( + _methodOriginClass.FullName, + _methodOriginClass.GetFullNameForErrorMessage(Architecture) + ); + + var loaderArchitecture = StaticTestArchitectures.LoaderTestArchitecture; + var duplicateClass = loaderArchitecture.GetClassOfType(typeof(DuplicateClass)); + var otherDuplicateClass = loaderArchitecture.GetClassOfType( + typeof(OtherDuplicateClass) + ); + + Assert.Equal( + duplicateClass.FullName + ", " + duplicateClass.Assembly.FullName, + duplicateClass.GetFullNameForErrorMessage(loaderArchitecture) + ); + Assert.Equal( + otherDuplicateClass.FullName + ", " + otherDuplicateClass.Assembly.FullName, + otherDuplicateClass.GetFullNameForErrorMessage(loaderArchitecture) + ); + } + + [Fact] + public void HasAmbiguousFullNameTest() + { + Assert.False(_methodOriginClass.HasAmbiguousFullName(Architecture)); + + var loaderArchitecture = StaticTestArchitectures.LoaderTestArchitecture; + var duplicateClass = loaderArchitecture.GetClassOfType(typeof(DuplicateClass)); + var otherDuplicateClass = loaderArchitecture.GetClassOfType( + typeof(OtherDuplicateClass) + ); + + Assert.True(duplicateClass.HasAmbiguousFullName(loaderArchitecture)); + Assert.True(otherDuplicateClass.HasAmbiguousFullName(loaderArchitecture)); + } + [Fact] public void HasMembersWithFullNameTest() { diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs index 9dcfe998b..e1726b2c1 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/MethodMemberSyntaxElementsTests.cs @@ -653,6 +653,22 @@ public async Task DoNotHaveReturnTypeTest() await helper.AssertSnapshotMatches(); } + [Fact] + public async Task HaveReturnTypeWithAmbiguousReturnTypeTest() + { + var helper = new MethodMemberAssemblyTestHelper(); + + helper.AddSnapshotHeader( + "Failure message disambiguates return type with the same full name in multiple assemblies" + ); + var should = MethodMembers().That().Are(helper.MethodWithAmbiguousReturnType).Should(); + + should.HaveReturnType(helper.RegularClass).AssertOnlyViolations(helper); + should.NotHaveReturnType(helper.AmbiguousReturnType).AssertOnlyViolations(helper); + + await helper.AssertSnapshotMatches(); + } + [Fact] public async Task BeMethodMembersThatTest() { diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt index 1464a84e8..9c28ed334 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.BeMethodMembersThatTest.verified.txt @@ -10,10 +10,10 @@ All Evaluations passed Query: Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors Result: False -Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void MethodMemberNamespace.RegularClass::.ctor()" or "System.Void MethodMemberNamespace.OtherRegularClass::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithStringReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`1::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`2::.ctor()" or "System.Void MethodMemberNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void MethodMemberNamespace.MethodDependencyClass::.ctor()" or "System.Void MethodMemberNamespace.OtherCallingClass::.ctor()" +Description: System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void MethodMemberNamespace.RegularClass::.ctor()" or "System.Void MethodMemberNamespace.OtherRegularClass::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithStringReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`1::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`2::.ctor()" or "System.Void MethodMemberNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void MethodMemberNamespace.MethodDependencyClass::.ctor()" or "System.Void MethodMemberNamespace.OtherCallingClass::.ctor()" or "System.Void DuplicateClassAcrossAssemblies.DuplicateClass::.ctor()" or "System.Void DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::.ctor()" or "System.Void DuplicateFullNameAssembly.DuplicateFullNameAssembly::.ctor()" or "System.Void DuplicateFullNameAssembly.ClassWithDuplicateParameters::.ctor()" or "System.Void DuplicateFullNameAssembly.CustomType::.ctor()" or "System.Void OtherDuplicateFullNameAssembly.OtherDuplicateFullNameAssembly::.ctor()" or "System.Void DuplicateClassAcrossAssemblies.DuplicateClass::.ctor()" Message: "Method members that are "System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod()" should be method members that are constructors" failed: - System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void MethodMemberNamespace.RegularClass::.ctor()" or "System.Void MethodMemberNamespace.OtherRegularClass::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithStringReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`1::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`2::.ctor()" or "System.Void MethodMemberNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void MethodMemberNamespace.MethodDependencyClass::.ctor()" or "System.Void MethodMemberNamespace.OtherCallingClass::.ctor()" + System.Void MethodMemberNamespace.ClassWithVirtualMethod::VirtualMethod() is not "System.Void MethodMemberNamespace.RegularClass::.ctor()" or "System.Void MethodMemberNamespace.OtherRegularClass::.ctor()" or "System.Void MethodMemberNamespace.ClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.OtherClassWithVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithNonVirtualMethod::.ctor()" or "System.Void MethodMemberNamespace.ClassWithStringReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.ClassWithOtherRegularClassReturnType::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`1::.ctor()" or "System.Void MethodMemberNamespace.GenericClass`2::.ctor()" or "System.Void MethodMemberNamespace.ClassWithGenericReturnType::.ctor()" or "System.Void MethodMemberNamespace.MethodDependencyClass::.ctor()" or "System.Void MethodMemberNamespace.OtherCallingClass::.ctor()" or "System.Void DuplicateClassAcrossAssemblies.DuplicateClass::.ctor()" or "System.Void DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::.ctor()" or "System.Void DuplicateFullNameAssembly.DuplicateFullNameAssembly::.ctor()" or "System.Void DuplicateFullNameAssembly.ClassWithDuplicateParameters::.ctor()" or "System.Void DuplicateFullNameAssembly.CustomType::.ctor()" or "System.Void OtherDuplicateFullNameAssembly.OtherDuplicateFullNameAssembly::.ctor()" or "System.Void DuplicateClassAcrossAssemblies.DuplicateClass::.ctor()" diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeWithAmbiguousReturnTypeTest.verified.txt b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeWithAmbiguousReturnTypeTest.verified.txt new file mode 100644 index 000000000..50246eeb2 --- /dev/null +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/MethodMemberSyntaxElementsTests.HaveReturnTypeWithAmbiguousReturnTypeTest.verified.txt @@ -0,0 +1,20 @@ +===== Failure message disambiguates return type with the same full name in multiple assemblies ===== + +Query: Method members that are "DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType()" should have return type "MethodMemberNamespace.RegularClass" +Result: False +Description: DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType() has return type "DuplicateClassAcrossAssemblies.DuplicateClass, DuplicateFullNameAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd0dc0bfa4" (the return type's full name is ambiguous in this architecture; its assembly is shown to disambiguate it) +Message: +"Method members that are "DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType()" should have return type "MethodMemberNamespace.RegularClass"" failed: + DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType() has return type "DuplicateClassAcrossAssemblies.DuplicateClass, DuplicateFullNameAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd0dc0bfa4" (the return type's full name is ambiguous in this architecture; its assembly is shown to disambiguate it) + + + +Query: Method members that are "DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType()" should not have return type "DuplicateClassAcrossAssemblies.DuplicateClass" +Result: False +Description: DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType() has return type "DuplicateClassAcrossAssemblies.DuplicateClass, DuplicateFullNameAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd0dc0bfa4" (the return type's full name is ambiguous in this architecture; its assembly is shown to disambiguate it) +Message: +"Method members that are "DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType()" should not have return type "DuplicateClassAcrossAssemblies.DuplicateClass"" failed: + DuplicateClassAcrossAssemblies.DuplicateClass DuplicateFullNameAssembly.ClassWithAmbiguousReturnType::MethodWithAmbiguousReturnType() has return type "DuplicateClassAcrossAssemblies.DuplicateClass, DuplicateFullNameAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=015ff5fd0dc0bfa4" (the return type's full name is ambiguous in this architecture; its assembly is shown to disambiguate it) + + + diff --git a/ArchUnitNETTests/Loader/ArchLoaderTests.cs b/ArchUnitNETTests/Loader/ArchLoaderTests.cs index e7e586e6f..280b2b46b 100644 --- a/ArchUnitNETTests/Loader/ArchLoaderTests.cs +++ b/ArchUnitNETTests/Loader/ArchLoaderTests.cs @@ -1,5 +1,5 @@ -extern alias LoaderTestAssemblyAlias; -extern alias OtherLoaderTestAssemblyAlias; +extern alias DuplicateFullNameAssemblyAlias; +extern alias OtherDuplicateFullNameAssemblyAlias; using System; using System.Collections.Generic; @@ -15,8 +15,8 @@ using static ArchUnitNET.Fluent.ArchRuleDefinition; using static ArchUnitNETTests.StaticTestArchitectures; -using DuplicateClass = LoaderTestAssemblyAlias::DuplicateClassAcrossAssemblies.DuplicateClass; -using OtherDuplicateClass = OtherLoaderTestAssemblyAlias::DuplicateClassAcrossAssemblies.DuplicateClass; +using DuplicateClass = DuplicateFullNameAssemblyAlias::DuplicateClassAcrossAssemblies.DuplicateClass; +using OtherDuplicateClass = OtherDuplicateFullNameAssemblyAlias::DuplicateClassAcrossAssemblies.DuplicateClass; namespace ArchUnitNETTests.Loader { @@ -203,8 +203,14 @@ public void SameFullNameInMultipleAssemblies() .Types.Where(type => type.Namespace.FullName == "DuplicateClassAcrossAssemblies") .ToList(); Assert.Equal(2, types.Count); - Assert.Single(types, type => type.Assembly.Name.StartsWith("LoaderTestAssembly")); - Assert.Single(types, type => type.Assembly.Name.StartsWith("OtherLoaderTestAssembly")); + Assert.Single( + types, + type => type.Assembly.Name.StartsWith("DuplicateFullNameAssembly") + ); + Assert.Single( + types, + type => type.Assembly.Name.StartsWith("OtherDuplicateFullNameAssembly") + ); // Loaded as stub types @@ -221,8 +227,14 @@ public void SameFullNameInMultipleAssemblies() ) .ToList(); Assert.Equal(2, types.Count); - Assert.Single(types, type => type.Assembly.Name.StartsWith("LoaderTestAssembly")); - Assert.Single(types, type => type.Assembly.Name.StartsWith("OtherLoaderTestAssembly")); + Assert.Single( + types, + type => type.Assembly.Name.StartsWith("DuplicateFullNameAssembly") + ); + Assert.Single( + types, + type => type.Assembly.Name.StartsWith("OtherDuplicateFullNameAssembly") + ); } [Fact] diff --git a/ArchUnitNETTests/StaticTestArchitectures.cs b/ArchUnitNETTests/StaticTestArchitectures.cs index 53f40be8b..af8d59c4d 100644 --- a/ArchUnitNETTests/StaticTestArchitectures.cs +++ b/ArchUnitNETTests/StaticTestArchitectures.cs @@ -42,8 +42,8 @@ public static class StaticTestArchitectures .WithoutRuleEvaluationCache() .WithoutArchitectureCache() .LoadAssemblies( - typeof(LoaderTestAssembly.LoaderTestAssembly).Assembly, - typeof(OtherLoaderTestAssembly.OtherLoaderTestAssembly).Assembly + typeof(DuplicateFullNameAssembly.DuplicateFullNameAssembly).Assembly, + typeof(OtherDuplicateFullNameAssembly.OtherDuplicateFullNameAssembly).Assembly ) .Build(); @@ -62,7 +62,11 @@ public static class StaticTestArchitectures public static readonly Architecture MethodMemberArchitecture = new ArchLoader() .WithoutRuleEvaluationCache() .WithoutArchitectureCache() - .LoadAssemblies(typeof(MethodMemberNamespace.RegularClass).Assembly) + .LoadAssemblies( + typeof(MethodMemberNamespace.RegularClass).Assembly, + typeof(DuplicateFullNameAssembly.DuplicateFullNameAssembly).Assembly, + typeof(OtherDuplicateFullNameAssembly.OtherDuplicateFullNameAssembly).Assembly + ) .Build(); public static readonly Architecture ArchUnitNETTestAssemblyArchitecture = new ArchLoader() diff --git a/TestAssemblies/DuplicateFullNameAssembly/ClassWithAmbiguousReturnType.cs b/TestAssemblies/DuplicateFullNameAssembly/ClassWithAmbiguousReturnType.cs new file mode 100644 index 000000000..3977917ea --- /dev/null +++ b/TestAssemblies/DuplicateFullNameAssembly/ClassWithAmbiguousReturnType.cs @@ -0,0 +1,9 @@ +namespace DuplicateFullNameAssembly; + +public class ClassWithAmbiguousReturnType +{ + public DuplicateClassAcrossAssemblies.DuplicateClass MethodWithAmbiguousReturnType() + { + return new DuplicateClassAcrossAssemblies.DuplicateClass(); + } +} diff --git a/TestAssemblies/LoaderTestAssembly/DuplicateClassAcrossAssemblies.cs b/TestAssemblies/DuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs similarity index 100% rename from TestAssemblies/LoaderTestAssembly/DuplicateClassAcrossAssemblies.cs rename to TestAssemblies/DuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs diff --git a/TestAssemblies/LoaderTestAssembly/LoaderTestAssembly.cs b/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.cs similarity index 83% rename from TestAssemblies/LoaderTestAssembly/LoaderTestAssembly.cs rename to TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.cs index d78500f17..77aec1eaf 100644 --- a/TestAssemblies/LoaderTestAssembly/LoaderTestAssembly.cs +++ b/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.cs @@ -1,6 +1,6 @@ -namespace LoaderTestAssembly; +namespace DuplicateFullNameAssembly; -public class LoaderTestAssembly { } +public class DuplicateFullNameAssembly { } public class ClassWithDuplicateParameters { diff --git a/TestAssemblies/LoaderTestAssembly/LoaderTestAssembly.csproj b/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj similarity index 100% rename from TestAssemblies/LoaderTestAssembly/LoaderTestAssembly.csproj rename to TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj diff --git a/TestAssemblies/OtherLoaderTestAssembly/DuplicateClassAcrossAssemblies.cs b/TestAssemblies/OtherDuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs similarity index 100% rename from TestAssemblies/OtherLoaderTestAssembly/DuplicateClassAcrossAssemblies.cs rename to TestAssemblies/OtherDuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs diff --git a/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.cs b/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.cs new file mode 100644 index 000000000..26baf6473 --- /dev/null +++ b/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.cs @@ -0,0 +1,3 @@ +namespace OtherDuplicateFullNameAssembly; + +public class OtherDuplicateFullNameAssembly { } diff --git a/TestAssemblies/OtherLoaderTestAssembly/OtherLoaderTestAssembly.csproj b/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj similarity index 100% rename from TestAssemblies/OtherLoaderTestAssembly/OtherLoaderTestAssembly.csproj rename to TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj diff --git a/TestAssemblies/OtherLoaderTestAssembly/OtherLoaderTestAssembly.cs b/TestAssemblies/OtherLoaderTestAssembly/OtherLoaderTestAssembly.cs deleted file mode 100644 index c775e8915..000000000 --- a/TestAssemblies/OtherLoaderTestAssembly/OtherLoaderTestAssembly.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace OtherLoaderTestAssembly; - -public class OtherLoaderTestAssembly { }