public static EndWith ( string expected ) : NUnit.Framework.Constraints.EndsWithConstraint | ||
expected | string | |
return | NUnit.Framework.Constraints.EndsWithConstraint |
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"); }
/// <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); }