public void Ctor_ConnectionStringOfConnectionIsNull() { IDbConnection connection = new NullConnection() { ConnectionString = null }; new DataContext(connection); }
public void Connection() { IDbConnection connection = new NullConnection() { ConnectionString = "" }; DataContext dc = new DataContext(connection); Assert.AreEqual(connection, dc.Connection); #if !L2SQL dc = new DataContext(new DummyConnection()); Assert.AreEqual(null, dc.Connection); #endif }
public void Connection() { IDbConnection connection = new NullConnection() { ConnectionString = "" }; DataContext dc = new DataContext(connection); Assert.AreEqual(connection, dc.Connection); var ex = Assert.Throws <Exception> (() => new DataContext(new DummyConnection())); Assert.Null(ex.InnerException); Assert.NotNull(ex.Message); Assert.True(ex.Message.IndexOf("'connection'") != -1); }
public void Connection() { IDbConnection connection = new NullConnection() { ConnectionString = "" }; DataContext dc = new DataContext(connection); Assert.AreEqual(connection, dc.Connection); #if !L2SQL dc = new DataContext (new DummyConnection()); Assert.AreEqual(null, dc.Connection); #endif }