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
Name
Gets a step name.
string Name { get; }
Property Value
Type
Gets a step type.
TestStepType Type { get; }
Property Value
Methods
AddComponent(ITestComponent)
Adds a new instance of the TestComponent class to the current object.
void AddComponent(ITestComponent component)
Parameters
component
ITestComponentThe 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
UriA Uri object that represents the URL of the page being validated.
settings
TestSettingsA TestSettings object that contains the settings for the test.
context
TestContextA TestContext object that represents the test context.
serviceProvider
IServiceProviderAn instance object of a mechanism for retrieving a service object.
cancellationToken
CancellationTokenAn optional CancellationToken object that can be used to cancel the this operation.
Returns
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
UriA Uri object that represents the URL of the page being validated.
settings
TestSettingsA TestSettings object that contains the settings for the test.
serviceProvider
IServiceProviderAn instance object of a mechanism for retrieving a service object.
cancellationToken
CancellationTokenAn optional CancellationToken object that can be used to cancel the this operation.
Returns
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
ITestComponentThe TestComponent instance to remove.
Returns
- bool
true
if component is successfully removed; otherwise,false
. This method also returnsfalse
when component was not found.