Skip to main content

Object Model-Based Testing

When an API specification is imported, Aethrix generates typed .NET classes (DTOs) from the schema. These classes can be used in C# Script test steps to build requests programmatically with full IntelliSense support.

Why Use Object Models?​

  • Compile-time safety for complex request structures
  • Easier to maintain than raw JSON/XML strings
  • Enables test parameterization with strongly-typed data

Accessing Generated Types​

Generated types are available in C# Script test steps and Reusable Actions under the namespace derived from the service name (e.g., CustomerManagement.CustomerService).

var request = new CustomerService.CreateCustomerRequest
{
FirstName = "Alice",
LastName = "Smith",
Email = "alice@example.com"
};

Combining with Send Request​

Use a C# Script step to build the object, then pass it to a Send Request step via environment variables.

Next Steps​