Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
        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();
            }
        }
Beispiel #3
0
        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();
            }
        }