public void TestParseConstant() { using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { TestDbProviderFactory.DefinedNextResult(new List <Bean>()); SqlServerCommand command = new SqlServerCommand("test", SqlResource.ResourceManager, "SqlTestConst"); command.ExecuteReader(); Assert.IsTrue(command.CommandText.Contains("'5' = 5")); command.Dispose(); } }
public void TestParseCurrentUserId() { using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { TestDbProviderFactory.DefinedNextResult(new List <Bean>()); SqlServerCommand command = new SqlServerCommand("test", SqlResource.ResourceManager, "SqlTestUserId"); command.ExecuteReader(); Assert.IsTrue(command.CommandText.Contains(":CURRENT_USER_ID IS NOT NULL")); command.Dispose(); } }
public void TestParseConstantIf() { using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { TestDbProviderFactory.DefinedNextResult(new List <Bean>()); AbstractSqlCommand command = new OracleClient.OracleSqlCommand("test", SqlResource.ResourceManager, "SqlTestConstIf"); command.Parameters.AddWithValue("PAR1", 5); command.ExecuteReader(); Assert.IsTrue(command.CommandText.Contains("1 = 1")); command.Dispose(); } }