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
componentITestComponentThe 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
urlUriA Uri object that represents the URL of the page being validated.
settingsTestSettingsA TestSettings object that contains the settings for the test.
contextTestContextA TestContext object that represents the test context.
serviceProviderIServiceProviderAn instance object of a mechanism for retrieving a service object.
cancellationTokenCancellationTokenAn 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
urlUriA Uri object that represents the URL of the page being validated.
settingsTestSettingsA TestSettings object that contains the settings for the test.
serviceProviderIServiceProviderAn instance object of a mechanism for retrieving a service object.
cancellationTokenCancellationTokenAn 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
componentITestComponentThe TestComponent instance to remove.
Returns
- bool
trueif component is successfully removed; otherwise,false. This method also returnsfalsewhen component was not found.