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")); } }
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(); } } }