public void FixtureSetup()
        {
            _database = new SqlDbUnitTest(ConnectionString);

            _database.ReadXmlSchema(@"..\..\Data\Lender.Slos.DataSet.xsd");
            _database.ReadXml(@"..\..\Data\ApplicationTotals_Scenario01.xml");
        }
Пример #2
0
 public virtual void TestFixtureSetUp()
 {
     _test = new SqlDbUnitTest(ConnectionStrings.TestDatabase);
     TestSchemaLoader.LoadTestSchema(_test);
     _test.ReadXml("ProviderData.xml");
     _objectContextFactory = new TestObjectContextFactory(ConnectionStrings.TestDatabase);
 }
        public void FixtureSetup()
        {
            _database = new SqlDbUnitTest(ConnectionString);

            _database.ReadXmlSchema(@"..\..\Data\Lender.Slos.DataSet.xsd");
            _database.ReadXml(@"..\..\Data\IndividualDalTests_Scenario01.xml");
        }
Пример #4
0
 public void TestFixtureSetUp()
 {
     EntityFrameworkProfiler.Initialize();
     Test = new SqlDbUnitTest(ConnectionStrings.TestDatabase);
     TestSchemaLoader.LoadTestSchema(Test);
     Test.ReadXml("SettingsData.xml");
 }
Пример #5
0
 public virtual void TestFixtureSetUp()
 {
     _test = new SqlDbUnitTest(ConnectionStrings.TestDatabase);
     TestSchemaLoader.LoadTestSchema(_test);
     _test.ReadXml("ServiceDetails\\ServiceDetails.xml");
     _objectContextFactory = new TestObjectContextFactory(ConnectionStrings.TestDatabase);
     _entityContextFactory = new TestEntityContextFactory(ConnectionStrings.TestDatabase);
 }
        public void Issue38_Test()
        {
            INDbUnitTest db = GetNDbUnitTest();

            db.ReadXmlSchema(@"Xml\MySql\DateAsPrimaryKey.xsd");
            db.ReadXml(@"Xml\MySql\DateAsPrimaryKey.xml");

            db.PerformDbOperation(DbOperationFlag.CleanInsertIdentity);
        }
Пример #7
0
 public virtual void TestFixtureSetUp()
 {
     AutoMapperConfiguration.Configure();
     _test = new SqlDbUnitTest(ConnectionStrings.TestDatabase);
     TestSchemaLoader.LoadTestSchema(_test);
     _test.ReadXml("CodeSnippets\\CodeSnippetDataRRSL.xml");
     _objectContextFactory = new TestObjectContextFactory(ConnectionStrings.TestDatabase);
     _entityContextFactory = new TestEntityContextFactory(ConnectionStrings.TestDatabase);
 }
Пример #8
0
        public void Update_Operation_Matches_Expected_Data()
        {
            using (INDbUnitTest database = GetNDbUnitTest())
            {
                DataSet expectedDataSet = BuildDataSet(GetXmlModFilename());

                database.ReadXmlSchema(ReadOnlyStreamFromFilename(GetXmlSchemaFilename()));
                database.ReadXml(ReadOnlyStreamFromFilename(GetXmlFilename()));

                database.PerformDbOperation(DbOperationFlag.DeleteAll);
                database.PerformDbOperation(DbOperationFlag.InsertIdentity);

                database.ReadXml(GetXmlModFilename());
                database.PerformDbOperation(DbOperationFlag.Update);

                DataSet actualDataSet = database.GetDataSetFromDb(null);

                Assert.That(actualDataSet.HasTheSameDataAs(expectedDataSet));
            }
        }
        public void TestFixtureSetUp()
        {
            _configuration = new Configuration();
            _configuration.Configure();
            _configuration.AddAssembly(typeof(Player).Assembly);
            _sessionFactory = _configuration.BuildSessionFactory();

            _mySqlDatabase = new SqlDbUnitTest(Properties.Settings.Default.NHibernateTrainingConnectionString);

            _mySqlDatabase.ReadXmlSchema(@"..\..\NHibernateTrainingDataSet.xsd");
            _mySqlDatabase.ReadXml(@"..\..\YearlyPitchingRepositoryTestData.xml");
        }
Пример #10
0
        public void Refresh_Operation_Matches_Expected_Data()
        {
            INDbUnitTest database = GetNDbUnitTest();

            DataSet expectedDataSet = BuildDataSet(GetXmlFilename());

            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();

            Assert.That(actualDataSet.HasTheSameDataAs(expectedDataSet));

            database.Dispose();
        }
Пример #11
0
        public void Setup(string data)
        {
            Migrate.Up(_connection.ConnectionString);

            _ndbUnitTest = new PostgresqlDbUnitTest(_connection.ConnectionString);
            _ndbUnitTest.ReadXmlSchema("Files/Schema.xsd");
            if (!string.IsNullOrEmpty(data))
            {
                _ndbUnitTest.ReadXml(data);
            }

            _ndbUnitTest.PerformDbOperation(DbOperationFlag.CleanInsertIdentity);
        }
Пример #12
0
        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));
            }
        }
Пример #13
0
        public void Test()
        {
            _connectionString = "Data Source=:memory:;Version=3;New=True;";

            //Create an Instance of the NDbUnit database test class
            donSqlDatabase = new SqlLiteDbUnitTest(_connectionString);

            //Tell the NDbUnit test class what schema and data files to use
            donSqlDatabase.ReadXmlSchema(@"..\..\MyDataset.xsd");
            donSqlDatabase.ReadXml(@"..\..\DonTestData.xml");

            //Delete all existing data in the database and load test data
            donSqlDatabase.PerformDbOperation(NDbUnit.Core.DbOperationFlag.CleanInsertIdentity);

            var connection = new SqlLiteDbCommandBuilder(_connectionString);
        }
Пример #14
0
 public void PutDataSetToDatabase(string xsdFilePath, string xmlFilePath)
 {
     _database.ReadXmlSchema(xsdFilePath);
     _database.ReadXml(xmlFilePath);
     _database.PerformDbOperation(DbOperationFlag.CleanInsertIdentity);
 }
Пример #15
0
 protected void Insert(string testData)
 {
     _unitTest.ReadXml(testData);
     _unitTest.PerformDbOperation(DbOperationFlag.CleanInsertIdentity);
 }