Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Within the Assertions array in the JSON document, the following sections are supported as Array Elements.

For Asserting on the DataSource Query:

Code Block
languagejs
{
    "SerializedType": "Consultingwerk.SmartUnit.OERA.RetrieveDataScenario.Scenario",
    "EntityName": "Consultingwerk.SimpleCustomerBusinessEntity.CustomerBusinessEntity",
    "EntityTables": "eCustomer",
    "BatchSize": 100,
    "StopAfter": 5,
    "QueryStrings": [
        "FOR EACH eCustomer WHERE eCustomer.CustNum = 1 or Customer.Country = \"USA\"  BY eCustomer.CustNum"
    ],
    "Assertions": [
        {
            "DataSourceQuery": "FOR EACH Customer WHERE Customer.CustNum = 1 or Customer.Country = \"USA\" BY Customer.CustNum INDEXED-REPOSITION"
        },
        {
            "WholeIndex": [false] 
        },
        {
            "IndexNames": ["CustNum,CountryPost"]
        }
    ]
}

NumResults

The NumResults section contains a JSON object with an INT64 property per Buffer who's num results should be asserted. In the above example, we require exactly one record to be returned for the eCustomer and eItem table.

...

The CanFind section contains a JSON array of objects with a buffer, mode and where properties. This allows to test for records matching the given criteria. As the mode property, we support first and unique. Using the CanFind, developers can also assert for field values using a where criteria like

Code Block
languagec#
eCustomer.CustNum = 1 AND eCustomer.Name = "Lift Line Skiin"

CanNotFind

The CanNotFind section is similar to the CanFind section, just requiring that the specified criterias are not met by any record.

MaxRuntime

The MaxRuntime section contains an INT64 value specifying the maximum allowed runtiem for the Business Entity read operation.

MaxReads

The MaxReads section contains a JSON object with an INT64 property per database table. The MaxReads assertion will assert the maximum number of reads in the given database tableslike

Code Block
languagec#
eCustomer.CustNum = 1 AND eCustomer.Name = "Lift Line Skiin"

CanNotFind

The CanNotFind section is similar to the CanFind section, just requiring that the specified criterias are not met by any record.

MaxRuntime

The MaxRuntime section contains an INT64 value specifying the maximum allowed runtiem for the Business Entity read operation.

MaxReads

The MaxReads section contains a JSON object with an INT64 property per database table. The MaxReads assertion will assert the maximum number of reads in the given database tables.

DataSourceQuery

The resulting query string for the first Entity Table, a single string.

WholeIndex

A JSON Array of boolean values indicating if a WHOLE-INDEX scan is performed for the matching data-source buffer. 

IndexNames

A JSON Array of strings indicating the index names used for the matching data-source buffer.

Using the Generic Mock Data Access factory

...