Skip to content

Commit d9fa4ed

Browse files
committed
tests: Add presence condition tests for node references
1 parent c868528 commit d9fa4ed

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/test/java/eu/europa/ted/efx/sdk2/EfxExpressionTranslatorV2Test.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,29 @@ void testPresenceCondition_WithNot() {
6565
"BT-00-Text is not present");
6666
}
6767

68+
@Test
69+
void testPresenceCondition_WithNodeReference() {
70+
testExpressionTranslationWithContext("SubNode", "ND-Root", "ND-SubNode is present");
71+
}
72+
73+
@Test
74+
void testPresenceCondition_WithNodeReference_WithNot() {
75+
testExpressionTranslationWithContext("not(SubNode)", "ND-Root",
76+
"ND-SubNode is not present");
77+
}
78+
79+
@Test
80+
void testPresenceCondition_WithAbsoluteNodeReference() {
81+
testExpressionTranslationWithContext("/*/SubNode", "BT-00-Text",
82+
"/ND-SubNode is present");
83+
}
84+
85+
@Test
86+
void testPresenceCondition_WithNodeReferenceWithPredicate() {
87+
testExpressionTranslationWithContext("SubNode['a' = 'a']", "ND-Root",
88+
"ND-SubNode['a' == 'a'] is present");
89+
}
90+
6891
@Test
6992
void testUniqueValueCondition() {
7093
testExpressionTranslationWithContext(

0 commit comments

Comments
 (0)