Exemple #1
0
 void ISetColumn.ConfigureMatcher(RowValueMatcher matcher)
 {
     if (Matcher != null)
     {
         matcher.RegisterMatcher(_cell.Key, Matcher);
     }
 }
Exemple #2
0
        public SetRowMatcher(IList <SetRow> expected, IList <SetRow> actual, RowValueMatcher matcher)
        {
            _expecteds = expected;
            _actuals   = actual;
            _matcher   = matcher;

            for (int i = 0; i < _expecteds.Count; i++)
            {
                _expecteds[i].ExpectedOrder = i + 1;
            }

            for (int i = 0; i < _actuals.Count; i++)
            {
                _actuals[i].ActualOrder = i + 1;
            }
        }
        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);
        }
Exemple #4
0
        public bool Matches(RowValueMatcher matcher, SetRow other)
        {
            if (MissingValues)
            {
                return(false);
            }

            foreach (var key in Values.Keys)
            {
                if (!other.Values.Has(key))
                {
                    return(false);
                }
                if (!matcher.Matches(key, Values[key], other.Values[key]))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #5
0
 public void ConfigureMatcher(RowValueMatcher matcher)
 {
 }