🧠 DATE_TIME_FROM Unit Tests - unit-test.logic.yaml🟢
- Contextual name: 🧠 unit-test.logic.yaml🟢
- ID:
/ce/unit-test/date-time-from/unit-test.logic.yaml
- Tags:
Uses
Test Results 🟢
Generated at: 2025-10-09T13:47:02.717461645Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
🟢 | Valid-ISO-8601 | ✔️ 199 | ✔️ unitTest(Valid-ISO-8601): '2024-10-27T14:30:00Z'.asDateTime() == '2024-10-27T14:30:00Z' | ✔️ null |
🟢 | Valid-Timezone-Offset | ✔️ 299 | ✔️ unitTest(Valid-Timezone-Offset): '2024-10-27T10:00:00-05:00'.asDateTime() == '2024-10-27T15:00:00Z' | ✔️ null |
🟢 | Valid-Date-Only | ✔️ 399 | ✔️ unitTest(Valid-Date-Only): '2024-10-27'.asDateTime() == '2024-10-27T00:00:00Z' | ✔️ null |
🟢 | Valid-Milliseconds | ✔️ 499 | ✔️ unitTest(Valid-Milliseconds): '2024-10-27T14:30:00.123Z'.asDateTime() == '2024-10-27T14:30:00.123Z' | ✔️ null |
🟢 | Null-Value-Empty-String | ✔️ 501 | ✔️ ''.isEmpty() | ✔️ null |
🟢 | Null-Value-Custom-With-IsEmpty-Check | ✔️ 601 | ✔️ 'N/A'.isEmpty() | ✔️ null |
🟢 | Null-Value-Custom-No-IsEmpty-Check | ✔️ 799 | ✔️ unitTest(Null-Value-Custom-No-IsEmpty-Check): 'N/A'.asDateTime().isEmpty() | ✔️ null |
🟢 | Null-Value-Null-Input | ✔️ 801 | ✔️ null.isEmpty() | ✔️ null |
🟢 | Null-Value-Empty-Whitespace | ✔️ 901 | ✔️ ' '.isEmpty() | ✔️ null |
🟢 | Invalid-Format | ✔️ 1002 | ✔️ 'invalid date'.checkIso8601() | ✔️ null |
Generation Bundle
File | MD5 | |
---|---|---|
Open | /ce/unit-test/date-time-from/policy.yaml | B82427E3B62E9981434C44298F5A3F9C |
Open | /ce/unit-test/date-time-from/unit-test.logic.yaml | B28AAC3CA423F11EE0F32444E99CD4FF |
Available Commands
repo-manager policies generate FULL /ce/unit-test/date-time-from/unit-test.logic.yaml
repo-manager policies generate DEBUG /ce/unit-test/date-time-from/unit-test.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/unit-test/date-time-from/unit-test.logic.yaml
repo-manager policies generate TESTS /ce/unit-test/date-time-from/unit-test.logic.yaml
# Execute tests
repo-manager policies test /ce/unit-test/date-time-from/unit-test.logic.yaml
Content
---
inputType: CA10__CaAwsInstance__c
conditions:
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 date and time"
check:
UNIT_TEST:
id: Valid-ISO-8601
expected:
text: "unitTest(Valid-ISO-8601): '2024-10-27T14:30:00Z'.asDateTime() == '2024-10-27T14:30:00Z'"
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27T14:30:00Z"
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T14:30:00Z"
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 with timezone offset"
check:
UNIT_TEST:
id: Valid-Timezone-Offset
expected:
text: "unitTest(Valid-Timezone-Offset): '2024-10-27T10:00:00-05:00'.asDateTime() == '2024-10-27T15:00:00Z'"
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27T10:00:00-05:00" # 10:00 AM EST = 3:00 PM UTC
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T15:00:00Z" # Expected result in UTC
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 date only"
check:
UNIT_TEST:
id: Valid-Date-Only
expected:
text: "unitTest(Valid-Date-Only): '2024-10-27'.asDateTime() == '2024-10-27T00:00:00Z'"
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27"
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T00:00:00Z"
- status: COMPLIANT
currentStateMessage: "Valid ISO 8601 with milliseconds"
check:
UNIT_TEST:
id: Valid-Milliseconds
expected:
text: "unitTest(Valid-Milliseconds): '2024-10-27T14:30:00.123Z'.asDateTime() == '2024-10-27T14:30:00.123Z'"
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "2024-10-27T14:30:00.123Z"
format: "ISO_8601"
undeterminedIf:
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2024-10-27T14:30:00.123Z"
- status: COMPLIANT
currentStateMessage: "Null value handling (empty string)"
check:
UNIT_TEST:
id: Null-Value-Empty-String
expected:
status: UNDETERMINED
subIndex: 1
text: "''.isEmpty()"
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: ""
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (custom null value) when also setting undeterminedIf.isEmpty"
check:
UNIT_TEST:
id: Null-Value-Custom-With-IsEmpty-Check
expected:
status: UNDETERMINED
subIndex: 1
text: "'N/A'.isEmpty()"
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: "N/A"
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (custom null value) without undeterminedIf.isEmpty"
check:
UNIT_TEST:
id: Null-Value-Custom-No-IsEmpty-Check
expected:
text: "unitTest(Null-Value-Custom-No-IsEmpty-Check): 'N/A'.asDateTime().isEmpty()"
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: "N/A"
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (null input)"
check:
UNIT_TEST:
id: Null-Value-Null-Input
expected:
status: UNDETERMINED
subIndex: 1
text: "null.isEmpty()"
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
UNIT_TEST_NULL:
returnType: TEXT
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Null value handling (whitespace string)"
check:
UNIT_TEST:
id: Null-Value-Empty-Whitespace
expected:
status: UNDETERMINED
subIndex: 1
text: "' '.isEmpty()"
arg:
IS_EMPTY:
arg:
DATE_TIME_FROM:
arg:
TEXT: " "
format: "ISO_8601"
nullValues:
- "N/A"
- "Unknown"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
- status: COMPLIANT
currentStateMessage: "Invalid format - Undetermined"
check:
UNIT_TEST:
id: Invalid-Format
expected:
status: UNDETERMINED
subIndex: 2
text: "'invalid date'.checkIso8601()"
arg:
IS_EQUAL:
left:
DATE_TIME_FROM:
arg:
TEXT: "invalid date"
format: "ISO_8601"
undeterminedIf:
isEmpty: "Input is empty"
invalidFormat: "Invalid date format"
right:
DATE_TIME: "2000-01-01T00:00:00Z"
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required