Class AzureTestData
- Namespace
- XBullet.EasyTesting.Azure
- Assembly
- XBullet.EasyTesting.Azure.dll
Creates common Azure SDK response and paging values without a mocking framework.
public static class AzureTestData
- Inheritance
-
AzureTestData
- Inherited Members
Methods
AsyncPageable<T>(params Page<T>[])
Creates an asynchronous pageable sequence from pages.
public static AsyncPageable<T> AsyncPageable<T>(params Page<T>[] pages) where T : notnull
Parameters
pagesPage<T>[]The non-null ordered array of pages to expose. An empty array produces an empty pageable sequence. Page instances and their raw responses remain caller-owned.
Returns
- AsyncPageable<T>
An asynchronous pageable sequence that yields the supplied pages in order.
Type Parameters
TThe non-null item type contained in the pages.
ModelResponse<T>(T, int, Action<TestAzureResponse>?)
Creates a model response with a configurable raw response.
public static Response<T> ModelResponse<T>(T value, int status = 200, Action<TestAzureResponse>? configure = null)
Parameters
valueTThe model value to retain in the response; nullable values are accepted when
Tpermits them.statusintThe raw HTTP status code from 100 through 599. The default is 200.
configureAction<TestAzureResponse>An optional callback invoked synchronously once with the new raw response before it is wrapped. The callback may mutate the response but must not dispose it.
Returns
- Response<T>
A model response containing
valueand the configured raw response. Dispose the raw response returned byGetRawResponse()after use.
Type Parameters
TThe type of model value carried by the response.
Page<T>(IEnumerable<T>, string?, Response?)
Creates one Azure result page.
public static Page<T> Page<T>(IEnumerable<T> values, string? continuationToken = null, Response? response = null) where T : notnull
Parameters
valuesIEnumerable<T>A non-null sequence of page values. The sequence is enumerated immediately into a stable array.
continuationTokenstringThe token for retrieving the next page, or null for a terminal page.
responseResponseThe optional raw response associated with the page. When null, a new 200 response is created. A supplied response is retained, and its caller retains disposal ownership.
Returns
- Page<T>
A page containing the materialized values, continuation token, and raw response.
Type Parameters
TThe non-null item type contained in the page.
Pageable<T>(params Page<T>[])
Creates a synchronous pageable sequence from pages.
public static Pageable<T> Pageable<T>(params Page<T>[] pages) where T : notnull
Parameters
pagesPage<T>[]The non-null ordered array of pages to expose. An empty array produces an empty pageable sequence. Page instances and their raw responses remain caller-owned.
Returns
- Pageable<T>
A synchronous pageable sequence that yields the supplied pages in order.
Type Parameters
TThe non-null item type contained in the pages.
Response(int, string?)
Creates a raw Azure response.
public static TestAzureResponse Response(int status = 200, string? reasonPhrase = null)
Parameters
statusintThe HTTP status code from 100 through 599. The default is 200.
reasonPhrasestringThe reason phrase, or null to derive a standard phrase from
status. Unknown status codes receive an empty phrase.
Returns
- TestAzureResponse
A new mutable response that the caller owns and should dispose after use.