Siemens.AspNet.MsTest.Sdk 0.1.0-alpha.82

Prefix Reserved
This is a prerelease version of Siemens.AspNet.MsTest.Sdk.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Siemens.AspNet.MsTest.Sdk --version 0.1.0-alpha.82
                    
NuGet\Install-Package Siemens.AspNet.MsTest.Sdk -Version 0.1.0-alpha.82
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Siemens.AspNet.MsTest.Sdk" Version="0.1.0-alpha.82" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Siemens.AspNet.MsTest.Sdk" Version="0.1.0-alpha.82" />
                    
Directory.Packages.props
<PackageReference Include="Siemens.AspNet.MsTest.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Siemens.AspNet.MsTest.Sdk --version 0.1.0-alpha.82
                    
#r "nuget: Siemens.AspNet.MsTest.Sdk, 0.1.0-alpha.82"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Siemens.AspNet.MsTest.Sdk&version=0.1.0-alpha.82&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Siemens.AspNet.MsTest.Sdk&version=0.1.0-alpha.82&prerelease
                    
Install as a Cake Tool

Siemens.AspNet.MsTest.Sdk

This NuGet package provides utilities for API testing with a focus on AWS DynamoDB and Docker. It helps set up DynamoDB services within a Docker container for testing purposes and includes additional features to manage environment variables and API interactions.

Features

  • DynamoDB Helper: Set up and interact with AWS DynamoDB in a Docker container.
  • Docker Helper: Spin up Docker containers for AWS DynamoDB.
  • API Test Utilities: Provides utilities for setting up API testing environments, including the configuration of environment variables.
  • Support for Multiple Environments: Easily configure testing environments, such as Development, Staging, or Production, with environment variables.

Installation

You can install this package using the following NuGet command:

dotnet add package Siemens.AspNet.MsTest.Sdk

Setup Example

API Test Base Setup

The following example demonstrates how to initialize the testing environment, configure DynamoDB, and set up environment variables.

/// <summary>
///     The base class for API testing, providing utilities for setting up and interacting with the API.
/// </summary>
private static ApiTestBase<Program> _apiTestBase = null!;

protected static HttpClient Client { get; private set; } = null!;

private static readonly IDynamoDbService DynamoDbService = DynamoDbServiceFactory.Create();

[AssemblyInitialize]
public static async Task AssemblyInitializeAsync(TestContext _)
{
    // 0. Ensure that previous tests were not interrupted
    await AssemblyCleanupAsync().ConfigureAwait(false);

    // 1. Setup DynamoDB service
    await DynamoDbService.SetupAsync<Program>().ConfigureAwait(false);

    // 2. Load environment variables
    var environmentVariables = EmbeddedFile.GetFileContentFrom("Properties.EnvironmentVariables.json")
                                           .FromJsonStringAs<Dictionary<string, string>>()
                                           .Select(keyValue => (keyValue.Key, keyValue.Value)).ToArray();

    // 3. Setup API test base environment
    _apiTestBase = new ApiTestBase<Program>("Development", // The environment name
                                            (_, _) =>
                                            {
                                            }, // Register services action
                                            environmentVariables); // Configure environment variables  

    // Additional setup logic can be added here
}

DynamoDB Docker Setup

The package includes utilities to set up a Docker container with AWS DynamoDB to simulate a real database environment for testing.

// Factory creation
// Sample code for running DynamoDB in a Docker container
var DynamoDbService = DynamoDbServiceFactory.Create();
// Via service collection
serviceCollection.AddDynamoDbService();

Contributing

Feel free to open issues or submit pull requests. If you are interested in contributing, please ensure to follow the coding standards and best practices used in this repository.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.180 0 6/24/2025
0.1.0-alpha.179 11 6/23/2025
0.1.0-alpha.178 11 6/23/2025
0.1.0-alpha.176 12 6/23/2025
0.1.0-alpha.174 105 6/19/2025
0.1.0-alpha.173 127 6/19/2025
0.1.0-alpha.172 103 6/17/2025
0.1.0-alpha.171 178 6/16/2025
0.1.0-alpha.169 102 6/16/2025
0.1.0-alpha.165 229 6/13/2025
0.1.0-alpha.164 215 6/13/2025
0.1.0-alpha.163 217 6/13/2025
0.1.0-alpha.160 256 6/12/2025
0.1.0-alpha.159 301 6/11/2025
0.1.0-alpha.158 253 6/11/2025
0.1.0-alpha.143 247 6/11/2025
0.1.0-alpha.142 252 6/11/2025
0.1.0-alpha.140 247 6/11/2025
0.1.0-alpha.139 304 6/10/2025
0.1.0-alpha.138 248 6/9/2025
0.1.0-alpha.137 41 6/7/2025
0.1.0-alpha.136 34 6/7/2025
0.1.0-alpha.135 65 6/6/2025
0.1.0-alpha.134 66 6/6/2025
0.1.0-alpha.130 105 6/5/2025
0.1.0-alpha.129 114 6/4/2025
0.1.0-alpha.128 100 6/4/2025
0.1.0-alpha.122 170 6/3/2025
0.1.0-alpha.121 112 6/1/2025
0.1.0-alpha.120 79 6/1/2025
0.1.0-alpha.118 110 5/28/2025
0.1.0-alpha.117 109 5/28/2025
0.1.0-alpha.116 113 5/28/2025
0.1.0-alpha.115 119 5/26/2025
0.1.0-alpha.114 145 5/22/2025
0.1.0-alpha.112 113 5/21/2025
0.1.0-alpha.111 113 5/20/2025
0.1.0-alpha.108 170 5/19/2025
0.1.0-alpha.104 181 5/18/2025
0.1.0-alpha.102 273 5/14/2025
0.1.0-alpha.101 191 5/14/2025
0.1.0-alpha.100 198 5/12/2025
0.1.0-alpha.99 223 5/12/2025
0.1.0-alpha.98 36 5/10/2025
0.1.0-alpha.97 40 5/10/2025
0.1.0-alpha.86 130 5/8/2025
0.1.0-alpha.85 111 5/8/2025
0.1.0-alpha.84 106 5/8/2025
0.1.0-alpha.82 120 5/7/2025
0.1.0-alpha.81 115 5/6/2025
0.1.0-alpha.76 46 5/3/2025
0.1.0-alpha.75 64 5/2/2025
0.1.0-alpha.74 66 5/2/2025
0.1.0-alpha.56 119 4/28/2025
0.1.0-alpha.55 128 4/28/2025
0.1.0-alpha.54 191 4/14/2025
0.1.0-alpha.53 174 4/14/2025
0.1.0-alpha.48 207 4/14/2025
0.1.0-alpha.47 152 4/9/2025
0.1.0-alpha.46 125 4/9/2025
0.1.0-alpha.44 136 4/7/2025
0.1.0-alpha.41 123 4/7/2025
0.1.0-alpha.40 125 4/7/2025
0.1.0-alpha.39 69 4/4/2025
0.1.0-alpha.38 84 4/4/2025
0.1.0-alpha.37 128 4/4/2025