示例#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();
            }
        }
示例#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();
            }
        }