Beispiel #1
0
        public ComparisonMismatch Contains(List <string[]> table, int startIndex = 1)
        {
            ComparisonMismatch comparison = new ComparisonMismatch();

            comparison.IsTrue(table.Count <= RowCount, "Expected row count exceeds actual row count");

            for (int row = startIndex; row < table.Count; row++)
            {
                bool isFound = true;
                for (int actualRow = 1; actualRow < RowCount; actualRow++)
                {
                    isFound = true;
                    var colCount = table[row].Count();
                    for (int col = 0; col < colCount; col++)
                    {
                        string header         = table[0][col];
                        string actualCellText = GetCell(actualRow, header).Text;
                        isFound = isFound & (table[row][col] != actualCellText);
                        if (!isFound)
                        {
                            break;
                        }
                    }
                }
                comparison.IsTrue(isFound, string.Format("Not found |{0}|", string.Join("|", table[row])));
            }
            return(comparison);
        }
Beispiel #2
0
        public ComparisonMismatch CompareToTable(List <string[]> table, int startIndex = 1)
        {
            ComparisonMismatch comparison = new ComparisonMismatch();

            comparison.IsTrue(table.Count == RowCount, "Row counts do not match");

            for (int row = startIndex; row < Math.Min(table.Count, RowCount); row++)
            {
                var colCount = table[row].Count();
                for (int col = 0; col < colCount; col++)
                {
                    string header         = table[0][col];
                    string actualCellText = GetCell(row, header).Text;
                    comparison.Compare(table[row][col], actualCellText, "Cell text does not match");
                }
            }
            return(comparison);
        }
Beispiel #3
0
        public ComparisonMismatch CompareToTable(Table table, int startIndex = 1)
        {
            ComparisonMismatch comparison = new ComparisonMismatch();

            comparison.IsTrue(table.Rows.Count == RowDataCount, "Row counts do not match");

            int rowIndex = startIndex;

            foreach (var row in table.Rows)
            {
                foreach (var header in table.Header)
                {
                    string actualCellText = GetCell(rowIndex, header).Text;
                    comparison.IsTrue(row[header] == actualCellText, "Cell text does not match");
                }
                rowIndex++;
            }
            return(comparison);
        }
        public ComparisonMismatch CompareToTable(Table table, int startIndex=1)
        {
            ComparisonMismatch comparison = new ComparisonMismatch();
            comparison.IsTrue(table.Rows.Count == RowDataCount, "Row counts do not match");

            int rowIndex = startIndex;
            foreach (var row in table.Rows)
            {
                foreach (var header in table.Header)
                {
                    string actualCellText = GetCell(rowIndex, header).Text;
                    comparison.IsTrue(row[header] == actualCellText, "Cell text does not match");
                }
                rowIndex++;
            }
            return comparison;
        }
        public ComparisonMismatch CompareToTable(List<string[]> table, int startIndex=1)
        {
            ComparisonMismatch comparison = new ComparisonMismatch();
            comparison.IsTrue(table.Count == RowCount, "Row counts do not match");

            for (int row = startIndex; row < Math.Min(table.Count, RowCount); row++)
            {
                var colCount = table[row].Count();
                for (int col = 0; col < colCount; col++)
                {
                    string header = table[0][col];
                    string actualCellText = GetCell(row, header).Text;
                    comparison.Compare(table[row][col], actualCellText, "Cell text does not match");
                }
            }
            return comparison;
        }
        public ComparisonMismatch Contains(List<string[]> table, int startIndex=1)
        {
            ComparisonMismatch comparison = new ComparisonMismatch();
            comparison.IsTrue(table.Count <= RowCount, "Expected row count exceeds actual row count");

            for (int row = startIndex; row < table.Count; row++)
            {
                bool isFound = true;
                for (int actualRow = 1; actualRow < RowCount; actualRow++)
                {
                    isFound = true;
                    var colCount = table[row].Count();
                    for (int col = 0; col < colCount; col++)
                    {
                        string header = table[0][col];
                        string actualCellText = GetCell(actualRow, header).Text;
                        isFound = isFound & (table[row][col] != actualCellText);
                        if (!isFound)
                        {
                            break;
                        }
                    }
                }
                comparison.IsTrue(isFound, string.Format("Not found |{0}|", string.Join("|", table[row])));
            }
            return comparison;
        }