StoryTeller.Testing.UserInterface.Exploring.TreeNodeSpecification.AssertMatch C# (CSharp) Method

AssertMatch() public method

public AssertMatch ( TreeNode hierarchyNode ) : void
hierarchyNode StoryTeller.UserInterface.Exploring.TreeNode
return void
        public void AssertMatch(TreeNode hierarchyNode)
        {
            List<TreeNodeToken> actual = getActual(hierarchyNode);

            try
            {
                Assert.AreEqual(_tokens.Count, actual.Count, "the count");
                actual.ShouldHaveTheSameElementsAs((IList) _tokens);
            }
            catch (Exception)
            {
                actual.ForEach(x => Debug.WriteLine(x));

                throw;
            }
        }

Usage Example

        public void handles_the_clear_test_results_message()
        {
            explorer.ResultStatusChanged(ResultStatus.Unknown);

            var spec =
                new TreeNodeSpecification(
                    @"
suite:s9
test:s9/t17
test:s9/t18
");

            spec.AssertMatch(view.TestNode);


            explorer.HandleMessage(new ClearResultsMessage());

            spec =
                new TreeNodeSpecification(
                    @"
suite:s1
suite:s1/s2
suite:s1/s2/s3
suite:s1/s2/s3/s4
test:s1/s2/s3/s4/t11
test:s1/s2/s3/t9
test:s1/s2/s3/t10
test:s1/s2/t7
test:s1/s2/t8
test:s1/t4
test:s1/t5
test:s1/t6
suite:s5
suite:s5/s6
suite:s5/s6/s7
suite:s5/s6/s7/s8
test:s5/s6/s7/s8/t15
test:s5/s6/s7/t14
test:s5/s6/t13
test:s5/t12
suite:s9
test:s9/t16
test:s9/t17
test:s9/t18
test:t1
test:t2
test:t3
");

            spec.AssertMatch(view.TestNode);
        }
All Usage Examples Of StoryTeller.Testing.UserInterface.Exploring.TreeNodeSpecification::AssertMatch