XBullet.EasyTesting.Azure
1.0.14
dotnet add package XBullet.EasyTesting.Azure --version 1.0.14
NuGet\Install-Package XBullet.EasyTesting.Azure -Version 1.0.14
<PackageReference Include="XBullet.EasyTesting.Azure" Version="1.0.14" />
<PackageVersion Include="XBullet.EasyTesting.Azure" Version="1.0.14" />
<PackageReference Include="XBullet.EasyTesting.Azure" />
paket add XBullet.EasyTesting.Azure --version 1.0.14
#r "nuget: XBullet.EasyTesting.Azure, 1.0.14"
#:package XBullet.EasyTesting.Azure@1.0.14
#addin nuget:?package=XBullet.EasyTesting.Azure&version=1.0.14
#tool nuget:?package=XBullet.EasyTesting.Azure&version=1.0.14
XBullet.EasyTesting.Azure
Deterministic Azure SDK responses, credentials, paging, and HTTP pipeline transport for tests.
The package targets .NET 8, .NET 9, and .NET 10 and depends only on Azure.Core plus the core
XBullet package. Service-specific Azure SDK packages remain in the application or test project.
Install
dotnet add package XBullet.EasyTesting.Azure
Responses and paging
Create raw responses, model responses, and pageable output without Moq or NSubstitute:
var response = AzureTestData.ModelResponse(
secret,
status: 200,
raw => raw.WithHeader("x-ms-request-id", "request-42"));
var page = AzureTestData.Page(
new[] { firstSecret, secondSecret },
continuationToken: null);
var pageable = AzureTestData.AsyncPageable(page);
Service-specific output models should still be created through the SDK's *ModelFactory type.
Credentials and dependency injection
TestTokenCredential returns a deterministic token, captures requested scopes, tenant and claims,
and can arrange authentication failures:
var credential = new TestTokenCredential("local-test-token");
using var factory = EasyTestHost.Create<Program>()
.UseAzureTestCredential(credential)
.ReplaceAzureClient(secretClient)
.Build();
factory.RegisterScenarioResource("Azure credential", credential);
The credential implements ITestScenarioResource, so registering it with a shared factory clears
captured requests between scenarios and includes non-secret request metadata in failure diagnostics.
Real Azure client pipeline tests
Use StubAzureHttpPipelineTransport in any Azure SDK client options to exercise the real client
request serialization, response parsing, and retry pipeline without network access:
var transport = new StubAzureHttpPipelineTransport()
.Respond(status: 500)
.Respond(status: 200);
var options = new BlobClientOptions
{
Transport = transport
};
var client = new BlobClient(
new Uri("https://storage.test/container/blob"),
new AzureSasCredential("sig=test"),
options);
var exists = await client.ExistsAsync(cancellationToken);
transport.VerifyCalled(RequestMethod.Head, "/container/blob", expectedCount: 2);
Responses are consumed in order, making transient-failure and retry tests deterministic. Recorded requests include method, URI, headers, and buffered content. Failure diagnostics omit header values, query strings, and body content so credentials and payloads are not exposed.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Core (>= 1.62.0)
- XBullet.EasyTesting (>= 1.0.14)
-
net8.0
- Azure.Core (>= 1.62.0)
- XBullet.EasyTesting (>= 1.0.14)
-
net9.0
- Azure.Core (>= 1.62.0)
- XBullet.EasyTesting (>= 1.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.