AutoBE
    Preparing search index...

    Equality validation predicate for TestValidator assertion.

    Generates TestValidator.equals() calls to verify that two values are equal. This is the most commonly used validation pattern in E2E tests for confirming API responses match expected values and ensuring data integrity throughout business workflows.

    Preferred over manual validation: Use this instead of IIfStatement with throw statements for equality checking.

    E2E testing scenarios:

    • Verifying API response data matches expected values
    • Confirming entity IDs are correctly preserved across API operations
    • Validating state transitions in business workflows
    • Ensuring data consistency after CRUD operations via API calls

    AI function calling usage: Use after API operations (IApiOperateStatement) to validate response data and confirm business logic execution. Essential for maintaining test reliability and catching regressions.

    interface IEqualPredicate {
        title: string & MinLength<1>;
        type: "equalPredicate";
        x: IExpression;
        y: IExpression;
    }
    Index

    Properties

    Properties

    title: string & MinLength<1>

    Descriptive title explaining what is being validated.

    🚨 CRITICAL: This MUST be a simple string value, NOT an expression! 🚨

    ❌ WRONG - DO NOT use expressions of any kind:

    • { type: "binaryExpression", operator: "+", left: "Customer", right: " validation" }
    • { type: "stringLiteral", value: "some string" }
    • Any IExpression types - this is NOT an expression field!

    ✅ CORRECT - Use direct string values only:

    • "Customer ID should match created entity"
    • Simple, complete descriptive text as a raw string

    Should clearly describe the business context and expectation being tested. This title appears in test failure messages to help with debugging.

    Examples:

    • "Customer ID should match created entity"
    • "Order status should be confirmed after payment"
    • "Product price should equal the specified amount"
    • "Review content should match updated values"

    AI title strategy: Use business-meaningful descriptions that explain the validation purpose and help developers understand test failures.

    type: "equalPredicate"

    Type discriminator.

    Expected value expression (first parameter to TestValidator.equals).

    Represents the value that should be returned or the expected state after a business operation. Typically literal values or previously captured data from earlier API operations.

    Common patterns:

    • String literals for expected names, statuses, or codes
    • Numeric literals for expected quantities, prices, or scores
    • Identifiers referencing captured entity IDs or data from API operations
    • Object literals for expected data structures

    AI value selection: Choose expected values that reflect realistic business outcomes and match the API response schema.

    Actual value expression (second parameter to TestValidator.equals).

    Represents the actual value returned from API operations or business operations that needs validation. Often property access expressions extracting specific fields from captured API response data.

    Common patterns:

    • Property access for API response fields (customer.id, order.status)
    • Identifiers for captured variables from API operations
    • Array/object element access for nested data from API responses
    • Function call results for computed values (excluding API calls)

    AI expression construction: Ensure the actual value expression extracts the correct data from API responses according to the schema structure.