public void AssertTable(string tableName, Table table, IEnumerable <FieldFilter> filters)
        {
            _specflowDb.AssertTableName(tableName);

            var expectedDataCollection = DataCollection.Load(table);

            _specflowDb.AssertTableSchema(tableName, expectedDataCollection, filters);

            var fields = expectedDataCollection.Rows[0].Values.Select(a => a.Name);
            var actualDataCollection = _specflowDbSchema.BuildDataCollection(tableName, fields, filters, _formatter);

            if (!DataCompare.Compare(expectedDataCollection, actualDataCollection, out string message))
            {
                Assert.Fail($"Table '{tableName}'.{Environment.NewLine}{message}");
            }
        }
Пример #2
0
        public void PopulateTable(string tableName, Table table, bool setIdentityInsert)
        {
            _specflowDb.AssertTableName(tableName);
            _specflowDb.AssertTableSchema(tableName, table);

            var datasetElement    = DataConverter.BuildDatasetElementFromSpecFlowTable(tableName, table, setIdentityInsert);
            var sqlDatabaseClient = _specflowDbSchema.GetClient();

            sqlDatabaseClient.WriteTable(datasetElement);
        }