public void Create() { IDatabase db = new Database(_provider, _connstring); IDbConnection conn = db.Create(); conn.ShouldNotBe(null); conn.State.ShouldBe(ConnectionState.Closed); }
public void Instantiate() { IDatabase db = new Database(_provider, _connstring); db.ShouldNotBe(null); db.IsSqlServerProvider.ShouldBe(true); db.IsSqlServerCeProvider.ShouldBe(false); db.IsOracleProvider.ShouldBe(false); }
public void UseConnection() { IDatabase db = new Database(_provider, _connstring); using (IDbConnection conn = db.Create()) { conn.ShouldNotBe(null); conn.Open(); conn.State.ShouldBe(ConnectionState.Open); using (IDbCommand cmd = conn.CreateCommand()) { cmd.CommandText = "SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES"; var count = cmd.ExecuteScalar(); count.ShouldBeAssignableTo<int>(); count.ShouldNotBe(0); } } }