Table of Contents

Class TestAgentExtensions

Namespace
Xping.Sdk.Core.Extensions
Assembly
Xping.Sdk.Core.dll

Provides extension methods for the TestAgent class to simplify the usage and management of test components.

public static class TestAgentExtensions
Inheritance
TestAgentExtensions
Inherited Members

Methods

Add<T>(TestAgent, T)

Adds a new test component to the TestAgent's container.

public static TestAgent Add<T>(this TestAgent testAgent, T component) where T : ITestComponent

Parameters

testAgent TestAgent

The TestAgent to which the component will be added.

component T

The test component instance to add.

Returns

TestAgent

The TestAgent with the component added to its container.

Type Parameters

T

The type of the test component to add, which must implement ITestComponent.

Exceptions

ArgumentNullException

Thrown if either the testAgent or the component is null.

Replace<T>(TestAgent, T)

Replaces an existing test component of the same name or adds a new one if it does not exist in the TestAgent's container.

public static TestAgent Replace<T>(this TestAgent testAgent, T component) where T : ITestComponent

Parameters

testAgent TestAgent

The TestAgent whose component will be replaced or added.

component T

The test component instance to reuse.

Returns

TestAgent

The TestAgent with the component reused in its container.

Type Parameters

T

The type of the test component to reuse, which must implement ITestComponent.

Exceptions

ArgumentNullException

Thrown if either the testAgent or the component is null.