Esempio n. 1
0
        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();
        }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
            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);
            }
Esempio n. 4
0
        //
        // 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);
        }
Esempio n. 5
0
 public PathAssert(PathDefinitionStep step, Path path)
 {
     _step = step;
     _path = path;
 }
Esempio n. 6
0
 internal void AssertException(PathDefinitionStep step, Path path)
 {
     AssertHelper.Throws <ArgumentException>(() =>
                                             step.Matches(GetDefinitionIterator(), path.GetIterator())
                                             );
 }