π§ LESS_THAN_EQUAL Unit Tests - unit-test.logic.yaml π’
- Contextual name: π§ unit-test.logic.yaml π’
- ID:
/ce/unit-test/less-than-equal/unit-test.logic.yaml
- Located in: π LESS_THAN_EQUAL Unit Tests π’
Flagsβ
- π’ Logic test success
- π’ Logic with test data
- π’ Unit-test logic
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS EC2 Instance | CA10__CaAwsInstance__c | 12 | 2 | 44 |
Usesβ
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:48:04.731545796Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | Simple-1 | βοΈ 199 | βοΈ unitTest(Simple-1): number(0.0) <= number(1.0) | βοΈ null |
π’ | Simple-2 | βοΈ 299 | βοΈ unitTest(Simple-2): not(number(1.0) <= number(0.0)) | βοΈ null |
π’ | Simple-3 | βοΈ 399 | βοΈ unitTest(Simple-3): number(1.0) <= number(1.0) | βοΈ null |
π’ | Simple-4 | βοΈ 499 | βοΈ unitTest(Simple-4): number(1.0) <= number(1.0000000001) | βοΈ null |
π’ | Precision-1 | βοΈ 599 | βοΈ unitTest(Precision-1): number(1.111111111222223E9) <= number(1.111111111222224E9) | βοΈ null |
π’ | Precision-2 | βοΈ 699 | βοΈ unitTest(Precision-2): number(1.1111111112222233E9) <= number(1.1111111112222235E9) | βοΈ null |
π’ | Precision-3 | βοΈ 799 | βοΈ unitTest(Precision-3): number(1.1111111112222235E9) <= number(1.1111111112222235E9) | βοΈ null |
π’ | Null-1 | βοΈ 899 | βοΈ unitTest(Null-1): not(null <= null) | βοΈ null |
π’ | Null-2 | βοΈ 999 | βοΈ unitTest(Null-2): not(number(-1.0) <= null) | βοΈ null |
π’ | Null-3 | βοΈ 1099 | βοΈ unitTest(Null-3): not(number(1.0) <= null) | βοΈ null |
π’ | Null-4 | βοΈ 1199 | βοΈ unitTest(Null-4): not(null <= number(-1.0)) | βοΈ null |
π’ | Null-5 | βοΈ 1299 | βοΈ unitTest(Null-5): not(null <= number(1.0)) | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/unit-test/less-than-equal/policy.yaml | 5245AD9A4640F962D12876E55EFCC1C9 |
Open | /ce/unit-test/less-than-equal/unit-test.logic.yaml | 6127B3808DFF754E2C33E85EFED9153D |
Open | /ce/unit-test/less-than-equal/test-data.json | F8CF8DB6B95DA4EDC537E159A809EB09 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/unit-test/less-than-equal/unit-test.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/unit-test/less-than-equal/unit-test.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/unit-test/less-than-equal/unit-test.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/unit-test/less-than-equal/unit-test.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/unit-test/less-than-equal/unit-test.logic.yaml
Contentβ
---
inputType: CA10__CaAwsInstance__c
testData:
- file: test-data.json
conditions:
- status: COMPLIANT
currentStateMessage: Simple-1
check:
UNIT_TEST:
id: Simple-1
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 0
right:
NUMBER: 1
- status: COMPLIANT
currentStateMessage: Simple-2
check:
UNIT_TEST:
id: Simple-2
arg:
NOT:
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1
right:
NUMBER: 0
- status: COMPLIANT
currentStateMessage: Simple-3
check:
UNIT_TEST:
id: Simple-3
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1
right:
NUMBER: 1
- status: COMPLIANT
currentStateMessage: Simple-4
check:
UNIT_TEST:
id: Simple-4
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1
right:
NUMBER: 1.0000000001
- status: COMPLIANT
currentStateMessage: Precision-1
check:
UNIT_TEST:
id: Precision-1
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1111111111.222223
right:
NUMBER: 1111111111.222224
- status: COMPLIANT
currentStateMessage: Precision-2
check:
UNIT_TEST:
id: Precision-2
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1111111111.2222234
right:
NUMBER: 1111111111.2222235
- status: COMPLIANT
currentStateMessage: Precision-3
check:
UNIT_TEST:
id: Precision-3
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1111111111.22222346
right:
NUMBER: 1111111111.22222345
- status: COMPLIANT
currentStateMessage: Null-1
check:
UNIT_TEST:
id: Null-1
arg:
NOT:
arg:
LESS_THAN_EQUAL:
left:
UNIT_TEST_NULL:
returnType: NUMBER
right:
UNIT_TEST_NULL:
returnType: NUMBER
- status: COMPLIANT
currentStateMessage: Null-2
check:
UNIT_TEST:
id: Null-2
arg:
NOT:
arg:
LESS_THAN_EQUAL:
left:
NUMBER: -1
right:
UNIT_TEST_NULL:
returnType: NUMBER
- status: COMPLIANT
currentStateMessage: Null-3
check:
UNIT_TEST:
id: Null-3
arg:
NOT:
arg:
LESS_THAN_EQUAL:
left:
NUMBER: 1
right:
UNIT_TEST_NULL:
returnType: NUMBER
- status: COMPLIANT
currentStateMessage: Null-4
check:
UNIT_TEST:
id: Null-4
arg:
NOT:
arg:
LESS_THAN_EQUAL:
left:
UNIT_TEST_NULL:
returnType: NUMBER
right:
NUMBER: -1
- status: COMPLIANT
currentStateMessage: Null-5
check:
UNIT_TEST:
id: Null-5
arg:
NOT:
arg:
LESS_THAN_EQUAL:
left:
UNIT_TEST_NULL:
returnType: NUMBER
right:
NUMBER: 1
otherwise:
status: INCOMPLIANT
currentStateMessage: Test Failed
remediationMessage: Developer Fix Required