Example #1
0
        public void Test_GetLimitClauseForBegin_HasNotClauseSet()
        {
            //---------------Set up test pack-------------------
            const string limitClauseAtBeginning = "";
            SqlFormatter sqlFormatter           = new SqlFormatter("", "", limitClauseAtBeginning, "");

            //---------------Assert Precondition----------------
            Assert.AreEqual("", sqlFormatter.LimitClauseAtBeginning);
            //---------------Execute Test ----------------------
            string limitClauseForBegin = sqlFormatter.GetLimitClauseCriteriaForBegin(10);

            //---------------Test Result -----------------------
            Assert.AreEqual("", limitClauseForBegin);
        }
Example #2
0
        public void Test_GetLimitClauseForBegin()
        {
            //---------------Set up test pack-------------------
            const string limitClauseAtBeginning = "TOP";
            SqlFormatter sqlFormatter           = new SqlFormatter("", "", limitClauseAtBeginning, "");

            //---------------Assert Precondition----------------
            Assert.AreEqual(limitClauseAtBeginning, sqlFormatter.LimitClauseAtBeginning);
            //---------------Execute Test ----------------------
            string limitClauseForBegin = sqlFormatter.GetLimitClauseCriteriaForBegin(10);
            //---------------Test Result -----------------------
            const string expectedLimitClauseForEnd = limitClauseAtBeginning + " 10";

            Assert.AreEqual(expectedLimitClauseForEnd, limitClauseForBegin);
        }