Esempio n. 1
0
        public void Ctor_ConnectionStringOfConnectionIsNull()
        {
            IDbConnection connection = new NullConnection()
            {
                ConnectionString = null
            };

            new DataContext(connection);
        }
Esempio n. 2
0
        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
        }
Esempio n. 3
0
        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 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
        }