Ejemplo n.º 1
0
        public void InsertSQLTest()
        {
            var bytes = new byte[] { 1, 2, 3 };

            using (var db = new ASP_DBEntities())
            {
                var sql = db.InsertSQL(typeof(TestClass), bytes);
                Assert.That(sql, Does.Contain("INSERT INTO"));
            }
        }
Ejemplo n.º 2
0
        public void InsertSQLExecutabilityTest()
        {
            var bytes = new byte[] { 1, 2, 3 };

            using (var db = new ASP_DBEntities())
                using (var trans = db.Database.BeginTransaction())
                {
                    try
                    {
                        var sql = db.InsertSQL(typeof(TestClass), bytes);
                        db.Database.ExecuteSqlRaw(sql);
                        // really just executability without exception
                    }
                    finally
                    {
                        trans.Rollback();
                    }
                }
        }