Table of Contents

Interface ITestComponent

Namespace
Xping.Sdk.Core.Components
Assembly
Xping.Sdk.Core.dll

The ITestComponent interface defines the methods and properties for a TestComponent base class.

public interface ITestComponent

Remarks

This interface is implemented by the TestComponent base class and is intended for unit testing purposes.

Properties

Components

Gets a read-only collection of the child TestComponent instances of the current object.

IReadOnlyCollection<ITestComponent> Components { get; }

Property Value

IReadOnlyCollection<ITestComponent>

Name

Gets a step name.

string Name { get; }

Property Value

string

Type

Gets a step type.

TestStepType Type { get; }

Property Value

TestStepType

Methods

AddComponent(ITestComponent)

Adds a new instance of the TestComponent class to the current object.

void AddComponent(ITestComponent component)

Parameters

component ITestComponent

The TestComponent instance to add.

HandleAsync(Uri, TestSettings, TestContext, IServiceProvider, CancellationToken)

This method performs the test step operation asynchronously.

Task HandleAsync(Uri url, TestSettings settings, TestContext context, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)

Parameters

url Uri

A Uri object that represents the URL of the page being validated.

settings TestSettings

A TestSettings object that contains the settings for the test.

context TestContext

A TestContext object that represents the test context.

serviceProvider IServiceProvider

An instance object of a mechanism for retrieving a service object.

cancellationToken CancellationToken

An optional CancellationToken object that can be used to cancel the this operation.

Returns

Task

ProbeAsync(Uri, TestSettings, IServiceProvider, CancellationToken)

Asynchronously performs a probe test on the specified URL using the specified settings.

Task<bool> ProbeAsync(Uri url, TestSettings settings, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)

Parameters

url Uri

A Uri object that represents the URL of the page being validated.

settings TestSettings

A TestSettings object that contains the settings for the test.

serviceProvider IServiceProvider

An instance object of a mechanism for retrieving a service object.

cancellationToken CancellationToken

An optional CancellationToken object that can be used to cancel the this operation.

Returns

Task<bool>

true if the test succeeded; otherwise, false.

Remarks

This method is only meant for quick test validation and is stateless.

RemoveComponent(ITestComponent)

Removes the specified instance of the TestComponent class from the current object.

bool RemoveComponent(ITestComponent component)

Parameters

component ITestComponent

The TestComponent instance to remove.

Returns

bool

true if component is successfully removed; otherwise, false. This method also returns false when component was not found.