Click or drag to resize

TemporalFixture Class

Used to run Temporal server and its related database and services as a Docker compose application on the current machine as a test fixture while tests are being performed and then deletes the application when the fixture is disposed.
Inheritance Hierarchy

Namespace:  Neon.Xunit.Temporal
Assembly:  Neon.Xunit.Temporal (in Neon.Xunit.Temporal.dll) Version: 2.14.0-alpha
Syntax
public sealed class TemporalFixture : DockerComposeFixture

The TemporalFixture type exposes the following members.

Constructors
  NameDescription
Public methodTemporalFixture
Constructs the fixture.
Top
Properties
  NameDescription
Public propertyApplicationName
Returns the running application name or null if the compose file has not been started.
(Inherited from DockerComposeFixture.)
Public propertyClient
Returns the TemporalClient to be used to interact with Temporal.
Public propertyHttpClient
Returns a HttpClient suitable for submitting requests to the HttpClient instance web server.
Public propertyIsRunning
Returns true if the fixture has been initialized.
(Inherited from TestFixture.)
Public propertyProxyClient

Returns a HttpClient suitable for submitting requests to the associated temporal-proxy process.

Note Note
This will return null if the temporal-proxy process was disabled by the settings.
Public propertySettings
Returns the settings used to connect to the Temporal cluster.
Public propertyState
Used by unit test classes to persist arbitrary name/value information across individual unit tests.
(Inherited from TestFixture.)
Top
Methods
  NameDescription
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from TestFixture.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodOnRestart
Called when an already started fixture is being restarted. This establishes a fresh Temporal connection.
(Overrides TestFixtureOnRestart.)
Public methodReset
This method completely resets the fixture by removing the Temporal compose application from Docker. Use Restart if you just want to restart a fresh Temporal instance.
(Overrides DockerComposeFixtureReset.)
Public methodRestart
Closes the existing Temporal connection and restarts the Temporal server and then establishes a new connection.
Public methodStart(Action)
Starts the fixture if it hasn't already been started including invoking the optional Action when the first time Start(Action) is called for a fixture instance.
(Inherited from TestFixture.)
Public methodStart(String, String, Boolean, String)

Starts the fixture by running a Docker compose application.

(Inherited from DockerComposeFixture.)
Public methodStart(TemporalSettings, String, String, String, LogLevel, Boolean, Boolean, Boolean, Boolean)

Starts a Temporal compose application if it's not already running. You'll generally want to call this in your test class constructor instead of Start(Action).

Public methodStartAsComposed(String, String, Boolean, String)
Used to start the fixture within a ComposedFixture.
(Inherited from DockerComposeFixture.)
Public methodStartAsComposed(TemporalSettings, String, String, String, LogLevel, Boolean, Boolean, Boolean, Boolean)
Used to start the fixture within a ComposedFixture.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberDefaultComposeFile
The default Docker compose file text used to spin up Temporal and its related services by the TemporalFixture.
Public fieldStatic memberNamespace
The default namespace configured for TemporalFixture clients.
Top
Remarks

This fixture assumes that Temporal is not currently running on the local workstation or is running as as a application named temporal-dev. You may see port conflict errors if either of these conditions are not true.

See Start(TemporalSettings, String, String, String, LogLevel, Boolean, Boolean, Boolean, Boolean) for more information about how this works.

Note Note
You can persist TemporalClient instances to the underlying State dictionary to make these clients available across all test methods. TemporalFixture ensures that any of these clients will be disposed when the fixture is disposed, reset, or restarted.
Thread Safety
Instance members of this type are safe for multi-threaded operations.
See Also