public void BuildSymbolTable_SetWithoutDeclare()
        {
            var ast = new SqlStatementListNode
            {
                new SqlSetNode
                {
                    Variable = new SqlVariableNode("@var"),
                    Right    = new SqlNumberNode(5)
                }
            };
            Action act = () => ast.BuildSymbolTables();

            act.Should().Throw <SymbolNotDefinedException>().And.Symbol.Should().Be("@var");
        }
        public void BuildSymbolTable_DeclareSet()
        {
            var ast = new SqlStatementListNode
            {
                new SqlDeclareNode
                {
                    Variable = new SqlVariableNode("@var"),
                    DataType = new SqlKeywordNode("INT")
                },
                new SqlSetNode
                {
                    Variable = new SqlVariableNode("@var"),
                    Right    = new SqlNumberNode(5)
                }
            };

            ast.BuildSymbolTables();
            ast.Symbols.GetInfoOrThrow("@var", null).OriginKind.Should().Be(SymbolOriginKind.UserDeclared);
        }