| {{#if hasExpectedConstraints}} |
| {{~#*inline "item"}}{{asLowerCamelCase name}}{{/inline}} |
| |
| {{~#if isOptional}} |
| {{~#if (hasProperty expectedConstraints "hasValue")}}VerifyOrReturn(CheckConstraintHasValue("{{>item}}", {{>actualValue}}, {{expectedConstraints.hasValue}}));{{/if}} |
| if ({{>actualValue}} != nil) { |
| {{else if isNullable}} |
| if ({{>actualValue}} != nil) { |
| {{/if}} |
| |
| {{#if (hasProperty expectedConstraints "type")}}VerifyOrReturn(CheckConstraintType("{{>item}}", "{{asTestType type isArray}}", "{{expectedConstraints.type}}"));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "format")}}VerifyOrReturn(CheckConstraintFormat("{{>item}}", "", "{{expectedConstraints.format}}"));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "startsWith")}}VerifyOrReturn(CheckConstraintStartsWith("{{>item}}", {{>actualValue}}, "{{expectedConstraints.startsWith}}"));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "endsWith")}}VerifyOrReturn(CheckConstraintEndsWith("{{>item}}", {{>actualValue}}, "{{expectedConstraints.endsWith}}"));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "isUpperCase")}}VerifyOrReturn(CheckConstraintIsUpperCase("{{>item}}", {{>actualValue}}, {{expectedConstraints.isUpperCase}}));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "isLowerCase")}}VerifyOrReturn(CheckConstraintIsLowerCase("{{>item}}", {{>actualValue}}, {{expectedConstraints.isLowerCase}}));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "isHexString")}}VerifyOrReturn(CheckConstraintIsHexString("{{>item}}", {{>actualValue}}, {{expectedConstraints.isHexString}}));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "minLength")}}VerifyOrReturn(CheckConstraintMinLength("{{>item}}", {{>actualValue}}, {{expectedConstraints.minLength}}));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "maxLength")}}VerifyOrReturn(CheckConstraintMaxLength("{{>item}}", {{>actualValue}}, {{expectedConstraints.maxLength}}));{{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "minValue")}} |
| VerifyOrReturn(CheckConstraintMinValue<{{chipType}}>("{{>item}}", [{{>actualValue}} {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.minValue type}})); |
| {{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "maxValue")}} |
| VerifyOrReturn(CheckConstraintMaxValue<{{chipType}}>("{{>item}}", [{{>actualValue}} {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.maxValue type}})); |
| {{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "contains")}} |
| {{#chip_tests_iterate_expected_list expectedConstraints.contains}} |
| VerifyOrReturn(CheckConstraintContains("{{asLowerCamelCase name}}", {{>actualValue}}, {{asTypedLiteral value type}})); |
| {{/chip_tests_iterate_expected_list}} |
| {{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "excludes")}} |
| {{#chip_tests_iterate_expected_list expectedConstraints.excludes}} |
| VerifyOrReturn(CheckConstraintExcludes("{{asLowerCamelCase name}}", {{>actualValue}}, {{asTypedLiteral value type}})); |
| {{/chip_tests_iterate_expected_list}} |
| {{/if}} |
| |
| {{~#if isOptional}} |
| } |
| {{else if isNullable}} |
| } |
| {{/if}} |
| |
| {{~#if (hasProperty expectedConstraints "notValue")}} |
| {{#if (isLiteralNull expectedConstraints.notValue)}} |
| VerifyOrReturn(CheckValueNonNull("{{>item}}", {{>actualValue}})); |
| {{else}} |
| VerifyOrReturn(CheckConstraintNotValue("{{>item}}", {{>actualValue}}, {{asTypedLiteral expectedConstraints.notValue type}})); |
| {{/if}} |
| {{/if}} |
| {{/if}} |