public static void AssertEmpty(this DataDiff diff) { if (diff.IsEmpty) { return; } Assert.Fail("Expected no differences\nBut was " + diff); }
private Row FromDataDiff(DataDiff d) { var r = new Row(); SimpleTableRow sr = null; var statusString = string.Empty; switch (d.Status) { case RowStatus.Inserted: statusString = HistorySchema.HistoryStatusInsert; sr = d.NewRow; break; case RowStatus.Updated: statusString = HistorySchema.HistoryStatusUpdate; sr = d.NewRow; break; case RowStatus.Deleted: statusString = HistorySchema.HistoryStatusDelete; sr = d.OldRow; break; case RowStatus.Unknown: throw new ApplicationException("Unknown status for diff row"); } if (sr != null) { int colNum = 1; // skip the diff status flag foreach (var col in _stagingTableColumns) { r[col] = sr.Get(colNum++); } r[HistorySchema.HistoryStatusColumnName] = statusString; r[HistorySchema.HistoryLogColumnName] = _logId; r[HistorySchema.HistoryFederatedColumnName] = 0; r[HistorySchema.HistoryAppliedColumnName] = 0; r[HistorySchema.HistoryStampColumnName] = DateTime.Now; } return(r); }