================================================================================
Case statements with enum qualified values using Enum:: pattern
================================================================================

codeunit 123 TestCodeunit
{
    procedure TestCaseWithEnumQualifiedValues()
    var
        PostingPolicy: Enum "Invoice Posting Policy";
    begin
        case PostingPolicy of
            Enum::"Invoice Posting Policy"::Prohibited:
                begin
                    Message('Prohibited');
                end;
            Enum::"Invoice Posting Policy"::Mandatory:
                begin
                    Message('Mandatory');
                end;
        end;
    end;
}

--------------------------------------------------------------------------------

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    object_id: (integer)
    object_name: (identifier)
    (procedure
      (procedure_keyword)
      name: (identifier)
      (var_section
        (var_keyword)
        (variable_declaration
          name: (identifier)
          type: (type_specification
            (object_reference_type
              object_type: (enum_keyword)
              reference: (quoted_identifier)))))
      (code_block
        (case_statement
          (case_keyword)
          expression: (identifier)
          (of_keyword)
          (case_branch
            pattern: (qualified_enum_value
              enum_type: (qualified_enum_value
                enum_type: (keyword_identifier
                  (enum_keyword))
                value: (quoted_identifier))
              value: (identifier))
            body: (code_block
              (call_expression
                function: (identifier)
                arguments: (argument_list
                  (string_literal)))))
          (case_branch
            pattern: (qualified_enum_value
              enum_type: (qualified_enum_value
                enum_type: (keyword_identifier
                  (enum_keyword))
                value: (quoted_identifier))
              value: (identifier))
            body: (code_block
              (call_expression
                function: (identifier)
                arguments: (argument_list
                  (string_literal))))))))))

================================================================================
Simple enum case pattern test
================================================================================

codeunit 124 SimpleTest
{
    procedure Test()
    var
        Policy: Enum "Invoice Posting Policy";
    begin
        case Policy of
            Enum::"Invoice Posting Policy"::Prohibited:
                Message('Test');
        end;
    end;
}

--------------------------------------------------------------------------------

(source_file
  (codeunit_declaration
    (codeunit_keyword)
    object_id: (integer)
    object_name: (identifier)
    (procedure
      (procedure_keyword)
      name: (identifier)
      (var_section
        (var_keyword)
        (variable_declaration
          name: (identifier)
          type: (type_specification
            (object_reference_type
              object_type: (enum_keyword)
              reference: (quoted_identifier)))))
      (code_block
        (case_statement
          (case_keyword)
          expression: (identifier)
          (of_keyword)
          (case_branch
            pattern: (qualified_enum_value
              enum_type: (qualified_enum_value
                enum_type: (keyword_identifier
                  (enum_keyword))
                value: (quoted_identifier))
              value: (identifier))
            body: (call_expression
              function: (identifier)
              arguments: (argument_list
                (string_literal)))))))))
