Table of Contents

Class SmartyAddressVerificationDiagnostics

Namespace
SEBT.Portal.Infrastructure.Services
Assembly
SEBT.Portal.Infrastructure.dll

Exercises SmartyAddressVerificationService against canned HTTP outcomes. Constructs the real service with a fake System.Net.Http.HttpMessageHandler that replays the requested response (or throws a transport failure), so the service's error handling and logging run without any network activity.

public sealed class SmartyAddressVerificationDiagnostics : IAddressVerificationDiagnostics
Inheritance
object
SmartyAddressVerificationDiagnostics
Implements

Constructors

SmartyAddressVerificationDiagnostics(IOptionsSnapshot<SmartySettings>, IOptionsSnapshot<AddressValidationPolicySettings>, ILogger<SmartyAddressVerificationService>)

Exercises SmartyAddressVerificationService against canned HTTP outcomes. Constructs the real service with a fake System.Net.Http.HttpMessageHandler that replays the requested response (or throws a transport failure), so the service's error handling and logging run without any network activity.

public SmartyAddressVerificationDiagnostics(IOptionsSnapshot<SmartySettings> smartySettingsSnapshot, IOptionsSnapshot<AddressValidationPolicySettings> policySettingsSnapshot, ILogger<SmartyAddressVerificationService> logger)

Parameters

smartySettingsSnapshot IOptionsSnapshot<SmartySettings>
policySettingsSnapshot IOptionsSnapshot<AddressValidationPolicySettings>
logger ILogger<SmartyAddressVerificationService>

Methods

ValidateAgainstCannedServerErrorAsync(CancellationToken)

Verifies a sample address against a canned Smarty server-error response, returning the verification outcome.

public Task<Result<AddressUpdateSuccess>> ValidateAgainstCannedServerErrorAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<Result<AddressUpdateSuccess>>

ValidateAgainstCannedSuccessAsync(string, CancellationToken)

Verifies a sample address against a canned successful Smarty response carrying the given JSON body, returning the verification outcome.

public Task<Result<AddressUpdateSuccess>> ValidateAgainstCannedSuccessAsync(string responseBody, CancellationToken cancellationToken = default)

Parameters

responseBody string
cancellationToken CancellationToken

Returns

Task<Result<AddressUpdateSuccess>>

ValidateAgainstTransportFailureAsync(CancellationToken)

Verifies a sample address against a simulated transport-level failure (e.g. firewall block, DNS failure), returning the verification outcome.

public Task<Result<AddressUpdateSuccess>> ValidateAgainstTransportFailureAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<Result<AddressUpdateSuccess>>