*** Settings ***
Documentation    Smoke tests for ACMS Backend Abstraction Layer protocols
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_acms_backends.py

*** Test Cases ***
InMemoryTextBackend Protocol Compliance
    [Documentation]    Verify InMemoryTextBackend satisfies TextBackend protocol
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    text-backend    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    acms-text-backend-ok

InMemoryVectorBackend Protocol Compliance
    [Documentation]    Verify InMemoryVectorBackend satisfies VectorBackend protocol
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    vector-backend    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    acms-vector-backend-ok

InMemoryGraphBackend Protocol Compliance
    [Documentation]    Verify InMemoryGraphBackend satisfies GraphBackend protocol
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    graph-backend    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    acms-graph-backend-ok

Result Dataclass Construction
    [Documentation]    Verify TextResult, VectorResult, and GraphResult creation
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    result-types    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    acms-result-types-ok

DI Container Backend Resolution
    [Documentation]    Verify DI container resolves all three backends
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    di-resolution    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    acms-di-resolution-ok

Backend Argument Validation
    [Documentation]    Verify backends reject invalid arguments
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    validation    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    acms-validation-ok
