Registry Mirror
Skip to content

NotImplementAny(interfaces) returns FAIL if interfaces is Empty #446

Closed

Description

@NielsApebs

Hello.

I tried to check if my Application implements any Interfaces from Domain Layer:

        var rule =  ArchRuleDefinition.Types()
        .That().ResideInNamespaceMatching($"^application")   // <-- application All Types of the application layer
        .Should().NotImplementAnyInterfaces(                           // <-- This fails
            ArchRuleDefinition.Interfaces()
            .That().ResidesInNamespaceMatching($"^domain"))  // <-- domain All Typs of the domain layer

Because the domain Layer does not contain any Interfaces yet, my test should always be green, but it fails.

After I discovered the NotImplementAnyInterfaces() Condition i found this in
TypeConditionsDefinitions -> NotImplementAny(interfaces):

        foreach (var ruleType in ruleTypes.ToList())
        {
            var matchingInterfaces =
                interfaceList.Count > 0
                    ? ruleType.ImplementedInterfaces.Intersect(interfaceList).ToList()
                    : ruleType.ImplementedInterfaces.ToList();          //<-- Maybe this should be EmptyList, otherwise it fails when interfaceList is empty.
                if (matchingInterfaces.Any())
                {
                    yield return new ConditionResult(
                        ruleType,
                        false,
        ...

Activity

  1. added
    needs-triage
    on Jan 19, 2026
  2. changed the title [-]NotImplementAny(interfaces) returns FAIL is interfaces is Empty[/-] [+]NotImplementAny(interfaces) returns FAIL if interfaces is Empty[/+] on Jan 21, 2026
  3. added
    kind/bug
    triage/accepted
    and removed
    needs-triage
    on Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugtriage/accepted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions