<PackageReference Include="NUnit" Version="4.3.2" />

SamePathOrUnderConstraint

SamePathOrUnderConstraint tests that one path is under another
using System.Runtime.CompilerServices; namespace NUnit.Framework.Constraints { [NullableContext(1)] [Nullable(0)] public class SamePathOrUnderConstraint : PathConstraint { public override string Description => "Path under or matching " + MsgUtils.FormatValue(expected); public SamePathOrUnderConstraint(string expected) : base(expected) { } [NullableContext(2)] protected override bool Matches(string actual) { if (actual == null) return false; string text = Canonicalize(expected); string text2 = Canonicalize(actual); if (!string.Equals(text, text2, DetermineComparisonType())) return IsSubPath(text, text2); return true; } } }