Table of Contents

Class Lifecycle

Namespace
Antithesis.SDK
Assembly
Antithesis.SDK.dll

The Lifecycle class contains methods used to inform Antithesis that particular test phases or milestones have been reached.

public static class Lifecycle
Inheritance
Lifecycle
Inherited Members

Remarks

If you include opaque CLR objects in your assertion details, the SDK may be unable to detect unsupported output from their serializers and emit the corresponding diagnostics.

Properties

IsAntithesis

Determines if this code is executing within Antithesis according to the existence of an Antithesis environment variable as documented on our website.

public static bool IsAntithesis { get; }

Property Value

bool

Methods

SendEvent(string?, JsonObject?)

Indicates to Antithesis that a certain event has been reached. It sends a structured log message to Antithesis that you may later use to aid debugging.

public static void SendEvent(string? name, JsonObject? details = null)

Parameters

name string

The name of the event being logged.

details JsonObject

Optional additional details, evaluated at runtime. Null means no details: setup omits the details key, and a user event has an empty object payload. An explicitly empty object is preserved. Serialization failures produce an antithesis_error record and the event is still emitted without the failed details.

SetupComplete(JsonObject?)

Indicates to Antithesis that setup has completed. Call this method when your system and workload are fully initialized. After this method is called, Antithesis will take a snapshot of your system and begin injecting faults. Calling this method multiple times or from multiple processes will have no effect. Antithesis will treat the first time any process called this method as the moment that the setup was completed.

public static void SetupComplete(JsonObject? details = null)

Parameters

details JsonObject

Optional additional details, evaluated at runtime. Null means no details: setup omits the details key, and a user event has an empty object payload. An explicitly empty object is preserved. Serialization failures produce an antithesis_error record and the event is still emitted without the failed details.