---
inputType: CA10__CaAwsInstance__c
conditions:
  - status: COMPLIANT
    currentStateMessage: From-Null
    check:
      UNIT_TEST:
        id: From-Null
        expected:
          text: "unitTest(From-Null): null.asListOfBytes(',') == listOfBytes([])"
        arg:
          IS_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  UNIT_TEST_NULL:
                    returnType: BYTES
            right:
              LIST:
                itemType: BYTES
                items: []
  - status: COMPLIANT
    currentStateMessage: From-Empty
    check:
      UNIT_TEST:
        id: From-Empty
        expected:
          text: "unitTest(From-Empty): bytes('').asListOfBytes(',') == listOfBytes([''])"
        arg:
          IS_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                   BYTES: ""
            right:
              LIST:
                itemType: BYTES
                items:
                  - ""
  - status: COMPLIANT
    currentStateMessage: From-Whitespace
    check:
      UNIT_TEST:
        id: From-Whitespace
        expected:
          text: "unitTest(From-Whitespace): bytes(' ').asListOfBytes(',') != listOfBytes([''])"
        arg:
          NOT_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: " "
            right:
              LIST:
                itemType: BYTES
                items:
                  - ""
  - status: COMPLIANT
    currentStateMessage: Single
    check:
      UNIT_TEST:
        id: Single
        expected:
          text: "unitTest(Single): bytes('a').asListOfBytes(',') == listOfBytes(['a'])"
        arg:
          IS_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: "a"
            right:
              LIST:
                itemType: BYTES
                items:
                  - "a"
  - status: COMPLIANT
    currentStateMessage: Single-Case
    check:
      UNIT_TEST:
        id: Single-Case
        expected:
          text: "unitTest(Single-Case): bytes('A').asListOfBytes(',') != listOfBytes(['a'])"
        arg:
          NOT_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: "A"
            right:
              LIST:
                itemType: BYTES
                items:
                  - "a"
  - status: COMPLIANT
    currentStateMessage: Single-Whitespaces
    check:
      UNIT_TEST:
        id: Single-Whitespaces
        expected:
          text: "unitTest(Single-Whitespaces): bytes(' a ').asListOfBytes(',') != listOfBytes(['a'])"
        arg:
          NOT_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: " a "
            right:
              LIST:
                itemType: BYTES
                items:
                  - "a"
  - status: COMPLIANT
    currentStateMessage: Empty-Values
    check:
      UNIT_TEST:
        id: Empty-Values
        expected:
          text: "unitTest(Empty-Values): bytes(',').asListOfBytes(',') == listOfBytes(['', ''])"
        arg:
          IS_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: ","
            right:
              LIST:
                itemType: BYTES
                items:
                  - ""
                  - ""
  - status: COMPLIANT
    currentStateMessage: Duplicate
    check:
      UNIT_TEST:
        id: Duplicate
        expected:
          text: "unitTest(Duplicate): bytes('a,a').asListOfBytes(',') != listOfBytes(['a'])"
        arg:
          NOT_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: "a,a"
            right:
              LIST:
                itemType: BYTES
                items:
                  - "a"
  - status: COMPLIANT
    currentStateMessage: Order
    check:
      UNIT_TEST:
        id: Order
        expected:
          text: "unitTest(Order): bytes('a,b').asListOfBytes(',') != listOfBytes(['b', 'a'])"
        arg:
          NOT_EQUAL:
            left:
              LIST_FROM:
                separator: ","
                arg:
                  BYTES: "a,b"
            right:
              LIST:
                itemType: BYTES
                items:
                  - "b"
                  - "a"
  - status: COMPLIANT
    currentStateMessage: Separator-NewLine
    check:
      UNIT_TEST:
        id: Separator-NewLine
        expected:
          text: "unitTest(Separator-NewLine): bytes('line1\\nline2\\nline3\\n').asListOfBytes('\\n') == listOfBytes(['line1', 'line2', 'line3', ''])"
        arg:
          IS_EQUAL:
            left:
              LIST_FROM:
                separator: "\n"
                arg:
                  BYTES: "line1\nline2\nline3\n"
            right:
              LIST:
                itemType: BYTES
                items:
                  - "line1"
                  - "line2"
                  - "line3"
                  - ""
  - status: COMPLIANT
    currentStateMessage: Separator-Word
    check:
      UNIT_TEST:
        id: Separator-Word
        expected:
          text: "unitTest(Separator-Word): bytes('banana').asListOfBytes('an') == listOfBytes(['b', '', 'a'])"
        arg:
          IS_EQUAL:
            left:
              LIST_FROM:
                separator: "an"
                arg:
                  BYTES: "banana"
            right:
              LIST:
                itemType: BYTES
                items:
                  - "b"
                  - ""
                  - "a"
otherwise:
  status: INCOMPLIANT
  currentStateMessage: Test Failed
  remediationMessage: Developer Fix Required