Search Results for

    Show / Hide Table of Contents

    Class EndsWithConstraint

    EndsWithConstraint can test whether a string ends with an expected substring.

    Inheritance
    object
    Constraint
    StringConstraint
    EndsWithConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    StringConstraint.expected
    StringConstraint.caseInsensitive
    StringConstraint.descriptionText
    StringConstraint.Using(StringComparison)
    StringConstraint.Using(CultureInfo)
    StringConstraint.ApplyTo<TActual>(TActual)
    StringConstraint.IgnoreCase
    StringConstraint.Description
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    Constraint.ApplyTo<TActual>(ref TActual)
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    Constraint.GetTestObject<TActual>(ActualValueDelegate<TActual>)
    Constraint.ToString()
    Constraint.GetStringRepresentation(IEnumerable)
    Constraint.GetStringRepresentation()
    Constraint.After(int)
    Constraint.After(int, int)
    Constraint.DisplayName
    Constraint.Arguments
    Constraint.Builder
    Constraint.And
    Constraint.With
    Constraint.Or
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class EndsWithConstraint : StringConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    EndsWithConstraint(string)

    Initializes a new instance of the EndsWithConstraint class.

    Declaration
    public EndsWithConstraint(string expected)
    Parameters
    Type Name Description
    string expected

    The expected string

    Methods

    View Source

    Matches(string?)

    Determines whether the actual string value ends with the expected substring.

    Declaration
    protected override bool Matches(string? actual)
    Parameters
    Type Name Description
    string actual

    The string value to test.

    Returns
    Type Description
    bool
    Overrides
    StringConstraint.Matches(string?)
    View Source

    Matches(string?, CultureInfo)

    Determines whether the actual string value ends with the expected substring, using the specified CultureInfo and case sensitivity specified by the constraint. If cultureInfo is not null, the comparison uses culture-specific rules; otherwise, it falls back to the default string comparison logic.

    Declaration
    protected override bool Matches(string? actual, CultureInfo cultureInfo)
    Parameters
    Type Name Description
    string actual

    The string value to test.

    CultureInfo cultureInfo

    The culture information to use for the comparison.

    Returns
    Type Description
    bool
    Overrides
    StringConstraint.Matches(string?, CultureInfo)
    View Source

    Matches(string?, StringComparison)

    Determines whether the actual string value ends with the expected substring, using the specified string comparison.

    Declaration
    protected override bool Matches(string? actual, StringComparison stringComparison)
    Parameters
    Type Name Description
    string actual

    The string value to test.

    StringComparison stringComparison

    The string comparison to use.

    Returns
    Type Description
    bool
    Overrides
    StringConstraint.Matches(string?, StringComparison)

    Implements

    IConstraint
    IResolveConstraint
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0