Пример #1
0
        public void LoadSchemaSpecification_should_throw_exception_when_connection_string_is_wrong()
        {
            // Arrange
            SqlSrvProvider db = new SqlSrvProvider(@"wrong database connection string");

            // Act & Assert
            Assert.Throws<ArgumentException>(() => db.LoadDbSpecification());
        }
Пример #2
0
        public void LoadSchemaSpecification_should_update_TableCount_property()
        {
            // Arrange
            SqlSrvProvider db = new SqlSrvProvider(@"Data Source=.\SQLEXPRESS;AttachDbFilename=""C:\SQL Server 2000 Sample Databases\NORTHWND.MDF"";Integrated Security=True;Connect Timeout=30;User Instance=True");

            // create schema specification
            SchemaSpecification scdb = db.LoadDbSpecification();

            // Assert
            Assert.That(Is.Equals(scdb.Tables.Count, 13));
        }
Пример #3
0
 public TestGenerator(string connectionString)
 {
     _connectionString = connectionString;
     SqlSrvProvider dbSchema = new SqlSrvProvider(connectionString);
     _schemaSpecification = dbSchema.LoadDbSpecification();
 }