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());
        }
        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));
        }
Example #3
0
 public TestGenerator(string connectionString)
 {
     _connectionString = connectionString;
     SqlSrvProvider dbSchema = new SqlSrvProvider(connectionString);
     _schemaSpecification = dbSchema.LoadDbSpecification();
 }
 public void Constructor_should_accept_a_string_parameter()
 {
     // Act
     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");
 }