public static void BeforeTestRun() { SqlDbUnitTest = new SqlDbUnitTest(ConfigurationManager.ConnectionStrings["tanktemp"].ConnectionString); SqlDbUnitTest.ReadXmlSchema(@"schema.xsd"); SqlDbUnitTest.ReadXml(@"testdata.xml"); SqlDbUnitTest.PerformDbOperation(DbOperationFlag.CleanInsertIdentity); }
public static void FixtureSetup(TestContext context) { database = new SqlDbUnitTest(ConfigurationManager.ConnectionStrings["DB"].ConnectionString); database.ReadXmlSchema(@"EmployeeADODatabase.xsd"); database.ReadXml(@"EmployeeADOTestData.xml"); database.PerformDbOperation(DbOperationFlag.DeleteAll); }
internal SqlDbUnitTest SetUpDatabase(string connectionString, Stream xsdStream, Stream dataStream, DbOperationFlag operation) { Assert.IsNotNull(xsdStream); Assert.IsNotNull(dataStream); SqlDbUnitTest dbUnitTest = new SqlDbUnitTest(connectionString); dbUnitTest.ReadXmlSchema(xsdStream); dbUnitTest.ReadXml(dataStream); dbUnitTest.PerformDbOperation(operation); return dbUnitTest; }
public void CreateFixtureNow() { SqlDbUnitTest dbUnit = new SqlDbUnitTest(connectionString); dbUnit.ReadXmlSchema(@"DBFixtures/JewelryItems.xsd"); DataSet ds = dbUnit.GetDataSetFromDb(); ds.WriteXml(@"DBFixtures/JewelryItemsAllCategories.xml"); }
public void Initialize() { // string connectionString = "server=localhost;user=dbuser;password=dbpassword;initial catalog=MyDatabase;"; NDbUnit.Core.INDbUnitTest mySqlDatabase = new NDbUnit.Core.SqlClient.SqlDbUnitTest(connectionString); mySqlDatabase.ReadXmlSchema(@"DBFixtures/JewelryItems.xsd"); mySqlDatabase.ReadXml(@"DBFixtures/JewelryItemsAllCategories.xml"); mySqlDatabase.PerformDbOperation(NDbUnit.Core.DbOperationFlag.CleanInsertIdentity); settingManager = MockRepository.GenerateStub <ISettingManager>(); }
protected INDbUnitTest SetUpDatabase(DbOperationFlag operation, Stream datasetStream = null) { Assert.IsNotNull(DatabaseSchema); SetUpNhibernateSession(); INDbUnitTest dbUnitTest = new SqlDbUnitTest(this.ConnectionString); dbUnitTest.ReadXmlSchema(this.DatabaseSchema); if(datasetStream != null) dbUnitTest.ReadXml(datasetStream); dbUnitTest.PerformDbOperation(operation); return dbUnitTest; }
public void Initialize() { // string connectionString = "server=localhost;user=dbuser;password=dbpassword;initial catalog=MyDatabase;"; NDbUnit.Core.INDbUnitTest mySqlDatabase = new NDbUnit.Core.SqlClient.SqlDbUnitTest(connectionString); mySqlDatabase.ReadXmlSchema(@"DBFixtures/JewelryItems.xsd"); mySqlDatabase.ReadXml(@"DBFixtures/JewelryItemsAllCategories.xml"); mySqlDatabase.PerformDbOperation(NDbUnit.Core.DbOperationFlag.CleanInsertIdentity); settingManager = MockRepository.GenerateStub<ISettingManager>(); }
private static void WipeOutDatabase() { SqlDbUnitTest testDb = new SqlDbUnitTest(@"Data Source=ISPG341\SQLEXPRESS;Initial Catalog=Daphne;Integrated Security=True"); testDb.ReadXmlSchema(@"..\..\database.xsd"); testDb.PerformDbOperation(DbOperationFlag.DeleteAll); }
protected static INDbUnitTest CreateDataController(string connectionStringKey) { var result = new SqlDbUnitTest(ConfigurationManager.ConnectionStrings[connectionStringKey].ConnectionString); using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Bits.IntegrationTests.Database.xsd")) { result.ReadXmlSchema(stream); } return result; }
private static INDbUnitTest ObterBaseDeDados() { var baseDeDados = new SqlDbUnitTest(ConfiguracaoDeTestes.StringDeConexao); return baseDeDados; }
public DatabaseCleaner ConnectTo(string connectionString) { _connection = new SqlDbUnitTest(connectionString); return this; }
public void GetMyTestDataXmlFile() { var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["IntegrationTests.Properties.Settings.TDDWithMVCConnectionString"].ConnectionString; var mySqlDatabase = new SqlDbUnitTest(connectionString); mySqlDatabase.ReadXmlSchema(DatabaseXsd02); System.Data.DataSet ds = mySqlDatabase.GetDataSetFromDb(); ds.WriteXml(TestdataXml02); }