Beispiel #1
0
        public void TestMultiplestatements()
        {
            var actual = new StatementList()
            {
                Statements = new List <Statement>()
                {
                    new SetVariableStatement()
                    {
                        ScalarExpression = new StringLiteral()
                        {
                            Value = "test"
                        },
                        VariableReference = new VariableReference()
                        {
                            Name = "@testvar"
                        }
                    },
                    new SetVariableStatement()
                    {
                        ScalarExpression = new StringLiteral()
                        {
                            Value = "test2"
                        },
                        VariableReference = new VariableReference()
                        {
                            Name = "@testvar2"
                        }
                    },
                    new SelectStatement()
                    {
                        SelectElements = new List <SelectExpression>()
                        {
                            new SelectNullExpression()
                        }
                    }
                }
            }.Print();
            var expected = "SET @testvar = 'test';\r\n" +
                           "SET @testvar2 = 'test2';\r\n" +
                           "SELECT NULL";

            actual.Should().Be(expected);
        }