Table of Contents

Class MockCbmsHttpHandler

Namespace
SEBT.Portal.StatePlugins.CO.CbmsApi.Mocks
Assembly
SEBT.Portal.StatePlugins.CO.CbmsApi.dll

HttpMessageHandler that returns mock CBMS API responses. Token, ping, and check-enrollment return static embedded JSON and do not need a data store. Phone lookup (get-account-details) and PATCH (update-std-dtls) require MockCbmsDataStore.

public sealed class MockCbmsHttpHandler : HttpMessageHandler
Inheritance
object
HttpMessageHandler
MockCbmsHttpHandler

Constructors

MockCbmsHttpHandler()

Handler for static mock responses (token, ping, check-enrollment).

public MockCbmsHttpHandler()

MockCbmsHttpHandler(MockCbmsDataStore)

public MockCbmsHttpHandler(MockCbmsDataStore dataStore)

Parameters

dataStore MockCbmsDataStore

Methods

Send(HttpRequestMessage, CancellationToken)

When overridden in a derived class, sends an HTTP request with the specified request and cancellation token. Otherwise, throws a System.NotSupportedException.

protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage

The HTTP request message to send.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

HttpResponseMessage

The HTTP response message.

Exceptions

NotSupportedException

The method is not overridden in the derived class.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

SendAsync(HttpRequestMessage, CancellationToken)

Send an HTTP request as an asynchronous operation.

protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage

The HTTP request message to send.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

The request was null.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.