Class XpingApiClient
HTTP client for uploading test executions to the Xping API with resilience policies.
public sealed class XpingApiClient : ITestResultUploader, IDisposable
- Inheritance
-
XpingApiClient
- Implements
- Inherited Members
Constructors
XpingApiClient(HttpClient, XpingConfiguration, IXpingSerializer?, IXpingLogger?)
Initializes a new instance of the XpingApiClient class.
public XpingApiClient(HttpClient httpClient, XpingConfiguration config, IXpingSerializer? serializer = null, IXpingLogger? logger = null)
Parameters
httpClientHttpClientThe HTTP client to use for API calls.
configXpingConfigurationThe Xping configuration.
serializerIXpingSerializerOptional serializer. If not provided, uses default XpingJsonSerializer with ApiOptions.
loggerIXpingLoggerOptional logger for diagnostics. If null, uses NullLogger.
Methods
Dispose()
Disposes the HTTP client resources.
public void Dispose()
UploadAsync(IEnumerable<TestExecution>, CancellationToken)
Uploads a batch of test executions to the Xping API. If the upload fails, an error is logged.
public Task<UploadResult> UploadAsync(IEnumerable<TestExecution> executions, CancellationToken cancellationToken = default)
Parameters
executionsIEnumerable<TestExecution>The test executions to upload.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
- Task<UploadResult>
A task containing the upload result.