EndWith() 공개 정적인 메소드

Returns a constraint that succeeds if the actual value ends with the substring supplied as an argument.
public static EndWith ( string expected ) : NUnit.Framework.Constraints.EndsWithConstraint
expected string
리턴 NUnit.Framework.Constraints.EndsWithConstraint
예제 #1
0
        private void CheckBeforeAfterActionPair(int index1, int index2, string testName, string tag)
        {
            var event1 = ActionAttributeFixture.Events[index1];
            var event2 = ActionAttributeFixture.Events[index2];

            Assert.That(event1, Does.StartWith(testName + "." + tag + ".Before"));
            Assert.That(event2, Does.StartWith(testName + "." + tag + ".After"));

            int index   = event1.LastIndexOf('.');
            var target1 = event1.Substring(index); // Target is last in string

            Assert.That(event2, Does.EndWith(target1), "Event mismatch");
        }
예제 #2
0
 /// <summary>
 /// Asserts that a string ends with another string.
 /// </summary>
 /// <param name="expected">The expected string</param>
 /// <param name="actual">The string to be examined</param>
 /// <param name="message">The message to display in case of failure</param>
 /// <param name="args">Arguments used in formatting the message</param>
 static public void EndsWith(string expected, string actual, string message, params object[] args)
 {
     Assert.That(actual, Does.EndWith(expected), message, args);
 }