StoryTeller.Engine.Sets.SetVerificationGrammar.Execute C# (CSharp) Méthode

Execute() public méthode

public Execute ( IStep containerStep, ITestContext context ) : void
containerStep IStep
context ITestContext
Résultat void
        public void Execute(IStep containerStep, ITestContext context)
        {
            var actualObjects = findTheObjects(containerStep, context);
            var actualRows = buildActualRows(actualObjects);
            var expectedRows = buildExpectedRows(context, containerStep);

            var valueMatcher = new RowValueMatcher(context);
            _comparer.Columns.Each(x => x.ConfigureMatcher(valueMatcher));

            var matcher = new SetRowMatcher(expectedRows, actualRows, valueMatcher);
            IList<SetRow> results = Ordered ? matcher.CompareOrdered() : matcher.Compare();

            markCounts(context, results);

            context.ResultsFor(containerStep).SetResult(results, _leafName);
        }

Usage Example

        public void SetUp()
        {
            grammar =
                Fixture.VerifyStringList(() => { throw new NotImplementedException(); }).Titled(
                    "The list of strings should be").LeafNameIs("row").Grammar();

            step = new Step("anything").WithChildren("row", new Step(), new Step(), new Step());

            var context = new TestContext();

            grammar.Execute(step, context);
            counts = context.Counts;

            rowResults = context.ResultsFor(step).GetResult<IList<SetRow>>(grammar.LeafName);
            stepResults = context.ResultsFor(step);
        }