public void InsertIdentity_Operation_Matches_Expected_Data() { using (INDbUnitTest database = GetNDbUnitTest()) { DataSet expectedDataSet = BuildDataSet(GetXmlFilename()); database.ReadXmlSchema(ReadOnlyStreamFromFilename(GetXmlSchemaFilename())); database.ReadXml(ReadOnlyStreamFromFilename(GetXmlFilename())); database.PerformDbOperation(DbOperationFlag.DeleteAll); database.PerformDbOperation(DbOperationFlag.InsertIdentity); DataSet actualDataSet = database.GetDataSetFromDb(null); Assert.That(actualDataSet.HasTheSameDataAs(expectedDataSet)); } }
public void Refresh_Operation_Matches_Expected_Data() { using (INDbUnitTest database = GetNDbUnitTest()) { database.ReadXmlSchema(ReadOnlyStreamFromFilename(GetXmlSchemaFilename())); database.ReadXml(ReadOnlyStreamFromFilename(GetXmlFilename())); database.PerformDbOperation(DbOperationFlag.DeleteAll); database.PerformDbOperation(DbOperationFlag.InsertIdentity); database.ReadXml(GetXmlRefreshFilename()); database.PerformDbOperation(DbOperationFlag.Refresh); DataSet actualDataSet = database.GetDataSetFromDb(null); DataSet originalDataSet = BuildDataSet(GetXmlFilename()); DataSet refreshDataSet = BuildDataSet(GetXmlRefreshFilename()); var expectedDataSet = new DataSet(); expectedDataSet.ReadXmlSchema(ReadOnlyStreamFromFilename(GetXmlSchemaFilename())); MergeDataSet(expectedDataSet, originalDataSet, refreshDataSet); Assert.That(actualDataSet.HasTheSameDataAs(expectedDataSet)); } }
public DataSet GetDataSetFromDatabase(string xsdFilePath) { _database.ReadXmlSchema(xsdFilePath); return(_database.GetDataSetFromDb()); }