internal void AssertNoMatch(PathDefinitionStep step, Path path) { var a = new PathAssert(step, path); a.AssertNoMatchWith(PathAssert.SucceedingNextStep); a.AssertMatchLengthWith(PathAssert.SucceedingNextStep, expectedLength: 0); a.AssertNextStepIsNotCalled(); }
public void AssertNoMatchWith( PathDefinitionStep nextStep, string message = "The step was expected to return a failing match." ) { var result = _step.Matches(GetDefinitionIterator(nextStep), _path.GetIterator()); Assert.IsFalse(result.Success, message); }
public void AssertMatchLengthWith( PathDefinitionStep nextStep, int expectedLength, string message = "Expected a match length of {0} but was {1}." ) { var result = _step.Matches(GetDefinitionIterator(nextStep), _path.GetIterator()); Assert.AreEqual(expectedLength, result.Length, message, expectedLength, result.Length); }
// // ASSERT HELPERS // internal void AssertMatchIfNextSucceeds(PathDefinitionStep step, Path path, int expectedMatchLength = 1) { var a = new PathAssert(step, path); a.AssertMatchWith(PathAssert.SucceedingNextStep); a.AssertNoMatchWith( PathAssert.FailingNextStep, "The step returned a successful match even though the next step returned a failure." ); a.AssertMatchLengthWith(PathAssert.SucceedingNextStep, expectedMatchLength); a.AssertMatchLengthWith(PathAssert.FailingNextStep, expectedMatchLength); a.AssertIteratorWasIncremented(expectedMatchLength); }
public PathAssert(PathDefinitionStep step, Path path) { _step = step; _path = path; }
internal void AssertException(PathDefinitionStep step, Path path) { AssertHelper.Throws <ArgumentException>(() => step.Matches(GetDefinitionIterator(), path.GetIterator()) ); }