Пример #1
0
        void CheckSelect(string from, string to)
        {
            if (from == null)
            {
                throw new ArgumentNullException("from");
            }

            if (to == null)
            {
                throw new ArgumentNullException("to");
            }

            IStatement statement = Factory.CreateStatement(from);

            Assert.IsNotNull(statement);

            MSqlServerTailor tailor = new MSqlServerTailor();

            statement.Traverse(tailor);
            Assert.AreEqual(to, TestUtil.Stringify(statement));
        }
Пример #2
0
        void CheckTailorError(string tooHard)
        {
            if (tooHard == null)
            {
                throw new ArgumentNullException("tooHard");
            }

            IStatement statement = Factory.CreateStatement(tooHard);

            Assert.IsNotNull(statement);

            try
            {
                MSqlServerTailor tailor = new MSqlServerTailor();
                statement.Traverse(tailor);
                Assert.Fail();
            }
            catch (InvalidOperationException exception)
            {
                Assert.IsNotNull(exception);
            }
        }