1+ Feature : Semantic Validation of CTO Scalars specification
2+
3+ Scenario : should pass for valid number bounds
4+ Given I load the following models:
5+ | model_file |alias |
6+ | scalars /models /NUMBER_VALIDATOR_001 /number_validator_001_valid_bounds .cto |main |
7+ Then no error should be thrown
8+
9+ Scenario : should throw for no number bounds
10+ Given I load the following models:
11+ | model_file |alias |
12+ | scalars /models /NUMBER_VALIDATOR_001 /number_validator_001_no_bounds .cto |main |
13+ Then an error should be thrown with message "/Expected \" /"
14+
15+ Scenario : should pass for valid number range
16+ Given I load the following models:
17+ | model_file |alias |
18+ | scalars /models /NUMBER_VALIDATOR_002 /number_validator_002_valid_range .cto |main |
19+ Then no error should be thrown
20+
21+ Scenario : should throw when lower > upper in number bounds
22+ Given I load the following models:
23+ | model_file |alias |
24+ | scalars /models /NUMBER_VALIDATOR_002 /number_validator_002_lower_greater_than_upper .cto |main |
25+ Then an error should be thrown with message "/Lower bound must be less than or equal to upper bound/"
26+
27+ Scenario : should pass for valid string length bounds
28+ Given I load the following models:
29+ | model_file |alias |
30+ | scalars /models /STRING_VALIDATOR_001 /string_validator_001_valid_bounds .cto |main |
31+ Then no error should be thrown
32+
33+ Scenario : should throw for empty string length bounds
34+ Given I load the following models:
35+ | model_file |alias |
36+ | scalars /models /STRING_VALIDATOR_001 /string_validator_001_no_bounds .cto |main |
37+ Then an error should be thrown with message "/Expected \" /"
38+
39+ Scenario : should pass for positive string length bounds
40+ Given I load the following models:
41+ | model_file |alias |
42+ | scalars /models /STRING_VALIDATOR_002 /string_validator_002_positive_bounds .cto |main |
43+ Then no error should be thrown
44+
45+ Scenario : should throw for negative bounds in string length
46+ Given I load the following models:
47+ | model_file |alias |
48+ | scalars /models /STRING_VALIDATOR_002 /string_validator_002_negative_bounds .cto |main |
49+ Then an error should be thrown with message "/minLength and-or maxLength must be positive integers/"
50+
51+ Scenario : should pass when lower < upper in string length
52+ Given I load the following models:
53+ | model_file |alias |
54+ | scalars /models /STRING_VALIDATOR_003 /string_validator_003_valid_order .cto |main |
55+ Then no error should be thrown
56+
57+ Scenario : should throw when lower > upper in string length
58+ Given I load the following models:
59+ | model_file |alias |
60+ | scalars /models /STRING_VALIDATOR_003 /string_validator_003_lower_greater_than_upper .cto |main |
61+ Then an error should be thrown with message "/minLength must be less than or equal to maxLength/"
62+
63+ Scenario : should throw for invalid regex
64+ Given I load the following models:
65+ | model_file |alias |
66+ | scalars /models /STRING_VALIDATOR_004 /string_validator_004_valid_regex .cto |main |
67+ Then no error should be thrown
68+
69+ Scenario : should pass for valid regex pattern
70+ Given I load the following models:
71+ | model_file |alias |
72+ | scalars /models /STRING_VALIDATOR_004 /string_validator_004_invalid_regex .cto |main |
73+ Then an error should be thrown with message "/Expected comment/"
0 commit comments