<PackageReference Include="NUnit" Version="3.0.0-rc-3" />

EndsWithConstraint

EndsWithConstraint can test whether a string ends with an expected substring.
namespace NUnit.Framework.Constraints { public class EndsWithConstraint : StringConstraint { public EndsWithConstraint(string expected) : base(expected) { descriptionText = "String ending with"; } protected override bool Matches(string actual) { if (caseInsensitive) return actual?.ToLower().EndsWith(expected.ToLower()) ?? false; return actual?.EndsWith(expected) ?? false; } } }