Beispiel #1
0
        public void Matches_ViewModelPlusProperty_Succeeds()
        {
            var path = Path
                       .Empty
                       .Append(VM)
                       .Append(EmployeeVM.ClassDescriptor.SelectedProject);

            PathAssert assert = new PathAssert(new AnyStepsStep <EmployeeVMDescriptor>(), path);

            assert.AssertMatchWith(PathAssert.SucceedingNextStep);
        }
Beispiel #2
0
        public void Matches_InnerStepSucceeds_Succeeds()
        {
            var optionalStep = new OptionalStep(PathAssert.SucceedingNextStep);

            var path = Path
                       .Empty
                       .Append(VM);

            var assert = new PathAssert(optionalStep, path);

            assert.AssertMatchWith(PathAssert.SucceedingNextStep);
        }
        //
        // 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);
        }