AspNetCore.Simple.MsTest.Sdk 1.1.2

This package has a SemVer 2.0.0 package version: 1.1.2+2.
There is a newer version of this package available.
See the version list below for details.
dotnet add package AspNetCore.Simple.MsTest.Sdk --version 1.1.2
                    
NuGet\Install-Package AspNetCore.Simple.MsTest.Sdk -Version 1.1.2
                    
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="AspNetCore.Simple.MsTest.Sdk" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AspNetCore.Simple.MsTest.Sdk" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="AspNetCore.Simple.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 AspNetCore.Simple.MsTest.Sdk --version 1.1.2
                    
#r "nuget: AspNetCore.Simple.MsTest.Sdk, 1.1.2"
                    
#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=AspNetCore.Simple.MsTest.Sdk&version=1.1.2
                    
Install AspNetCore.Simple.MsTest.Sdk as a Cake Addin
#tool nuget:?package=AspNetCore.Simple.MsTest.Sdk&version=1.1.2
                    
Install AspNetCore.Simple.MsTest.Sdk as a Cake Tool

AspNetCore.Simple.MsTest.Sdk

Target of this package is to write more efficient clean test against your ASP.Net Core API's. You will save tons of Assert and will be able to write even more faster and better readable test as before. Main reason was to be more focused on the Test-First approach.

Getting started

Prerequisites

Install the package

dotnet add package AspNetCore.Simple.MsTest.Sdk

Samples

Basic concept

// Those assert helper are smart they do following things:
// - Assser the expected call for Sucess -> AssertPostAsync -> Ok AssertPostAsErrorAsync -> NOK
// - It compares the complete reponse structure for equality -> Not only IsSuccessStatusCode, Also deep object 
// - You can provide json as string, or like here in the sample a json file which is embedded in the test assembly
// - Why json -> it is that fomat which is used for communication, and you can directly use your payloads in curl, 
//   postman or anywhere -> if you have c# code -> transform first into json, not nice to handle comparison
// - With this syntax you see directly the route which will be called
// - It is all made for maximize productivity

await Client.AssertPostAsync<AddUserReponse>($"api/v1/users/",                                                                        
                                             "Users.V1.Payloads.NewUser.json,
                                             "Users.V1.Results.NewUser.json);

Embedded json file or native json string

[TestMethod]
public Task Should_Return_No_Users_If_No_One_Was_Added()
{
    return Client.AssertGetAsync<GetAllUsersResponse>("v1/users", "EmptyUserResponse.json");
}
[TestMethod]
public Task Should_Return_No_Users_If_No_One_Was_Added()
{
    return Client.AssertGetAsync<GetAllUsersResponse>("v1/users", """{ "Users": [] }""");
}

Assert that GET all Users will returned 401 Unauthorized

[TestMethod]
public Task Should_Not_Return_All_Users_Without_Authentication()
{
    return Client.AssertGetAsUnauthorizedAsync("v1/users");
}

Assert that GET a user which not exists returns ProblemDetails

[TestMethod]
public Task Should_Return_Not_Found_Error_If_User_Does_Not_Exits()
{
    return Client.AssertGetAsErrorAsync<ProblemDetails>($"v1/users/{1234}", "UserGetByIdErrorResponse.json");
}

Assert that GET all Users is successful and checks that response is empty

[TestMethod]
public Task Should_Return_No_Users_If_No_One_Was_Added()
{
    return Client.AssertGetAsync<GetAllUsersResponse>("v1/users", "EmptyUserResponse.json");
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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
6.1.2 27 6/16/2025
6.1.1 63 6/13/2025
6.1.0 148 6/10/2025
6.0.22 30 6/10/2025
6.0.21 225 5/27/2025
6.0.20 39 5/27/2025
6.0.19 128 5/19/2025
6.0.18 3,251 5/2/2025
6.0.17 201 4/9/2025
6.0.16 64 4/9/2025
6.0.15 58 4/9/2025
6.0.14 398 3/23/2025
6.0.13 84 3/22/2025
6.0.12 3,170 3/17/2025
6.0.11 56 3/17/2025
6.0.10 105 3/16/2025
6.0.9 721 3/13/2025
6.0.8 1,601 3/6/2025
6.0.7 197 3/4/2025
6.0.6 178 3/3/2025
6.0.5 2,044 2/11/2025
6.0.4 151 2/8/2025
6.0.3 1,052 2/2/2025
6.0.2 9,063 1/24/2025
6.0.1 100 1/24/2025
6.0.0 108 1/24/2025
5.1.4 27,647 1/19/2025
5.1.3 78 1/19/2025
5.1.2 84 1/18/2025
5.1.1 278 1/8/2025
5.1.0 116 1/5/2025
5.1.0-alpha.24 100 1/5/2025
5.1.0-alpha.21 77 1/5/2025
5.1.0-alpha.19 91 1/5/2025
5.1.0-alpha.17 97 1/4/2025
5.1.0-alpha.13 99 1/4/2025
5.1.0-alpha.8 111 1/3/2025
5.0.1 3,324 1/1/2025
5.0.0 19,151 11/20/2024
4.0.13 50,066 11/18/2024
4.0.12 7,036 11/13/2024
4.0.11 3,863 11/6/2024
4.0.10 21,949 9/6/2024
4.0.9 3,382 9/5/2024
4.0.8 3,642 9/3/2024
4.0.7 7,684 8/28/2024
4.0.6 3,711 8/27/2024
4.0.5 3,304 8/27/2024
4.0.4 3,302 8/27/2024
4.0.3 3,360 8/26/2024
4.0.2 3,291 8/26/2024
4.0.1 6,507 8/26/2024
4.0.0 3,314 8/26/2024
3.1.1 3,653 8/21/2024
3.1.0 3,377 8/20/2024
3.0.4 3,675 8/5/2024
3.0.3 9,334 6/20/2024
3.0.2 3,847 5/26/2024
3.0.1 4,596 4/29/2024
3.0.0 3,453 4/23/2024
2.0.2 3,758 4/7/2024
2.0.1 5,275 2/7/2024
2.0.0 9,354 11/28/2023
1.1.8 4,694 10/29/2023
1.1.7 3,335 10/29/2023
1.1.6 3,469 10/24/2023
1.1.5 8,149 7/20/2023
1.1.4 3,504 7/20/2023
1.1.3 5,011 5/31/2023
1.1.2 3,351 5/29/2023
1.1.1 4,008 5/20/2023
1.1.0 3,347 5/20/2023
1.0.9 4,831 4/30/2023
1.0.8 3,468 4/19/2023
1.0.7 3,359 4/18/2023
1.0.6 3,354 4/18/2023
1.0.5 4,444 3/23/2023
1.0.4 3,376 3/23/2023
1.0.3 7,000 1/1/2023
1.0.2 3,382 1/1/2023
1.0.1 3,356 1/1/2023
1.0.0 3,396 11/24/2022
0.7.0 5,768 11/21/2022
0.7.0-alpha.24 172 11/21/2022
0.7.0-alpha.23 2,212 10/23/2022
0.7.0-alpha.22 128 10/23/2022
0.7.0-alpha.20 199 10/20/2022
0.7.0-alpha.18 504 10/7/2022
0.7.0-alpha.16 146 10/3/2022
0.7.0-alpha.14 138 10/3/2022
0.7.0-alpha.13 144 10/3/2022
0.7.0-alpha.12 145 10/3/2022
0.7.0-alpha.11 130 10/3/2022
0.7.0-alpha.8 133 10/3/2022
0.7.0-alpha.7 140 10/3/2022
0.6.1 3,342 10/1/2022
0.6.0 3,324 10/1/2022
0.5.1 4,393 9/4/2022
0.5.0 3,326 9/4/2022
0.4.0 1,832 9/3/2022
0.3.1 1,860 8/24/2022
0.3.0 1,961 8/4/2022
0.2.0 1,949 7/25/2022
0.2.0-alpha.89 264 7/8/2022
0.2.0-alpha.87 156 7/8/2022
0.2.0-alpha.85 255 7/4/2022
0.2.0-alpha.83 214 6/30/2022
0.2.0-alpha.82 191 6/21/2022
0.2.0-alpha.81 306 6/19/2022
0.2.0-alpha.79 157 6/19/2022
0.2.0-alpha.77 271 5/25/2022
0.2.0-alpha.71 489 4/28/2022
0.2.0-alpha.70 345 3/11/2022
0.2.0-alpha.69 169 3/11/2022
0.2.0-alpha.68 1,022 7/2/2021
0.2.0-alpha.67 2,180 5/17/2021
0.2.0-alpha.66 749 4/26/2021
0.2.0-alpha.63 230 4/25/2021
0.2.0-alpha.54 366 4/22/2021
0.2.0-alpha.53 208 4/22/2021
0.2.0-alpha.51 234 4/20/2021
0.2.0-alpha.49 300 4/18/2021
0.2.0-alpha.48 258 4/18/2021
0.2.0-alpha.47 212 4/18/2021
0.2.0-alpha.46 204 4/17/2021
0.2.0-alpha.45 207 4/17/2021
0.2.0-alpha.44 207 4/17/2021
0.2.0-alpha.43 216 4/17/2021
0.1.0-alpha.39 215 4/17/2021
0.1.0-alpha.37 228 4/17/2021
0.1.0-alpha.35 228 4/17/2021
0.1.0-alpha.34 230 4/17/2021
0.1.0-alpha.31 223 4/16/2021
0.1.0-alpha.30 236 4/14/2021
0.1.0-alpha.29 215 4/14/2021
0.1.0-alpha.28 289 4/10/2021
0.1.0-alpha.20 215 4/9/2021
0.1.0-alpha.18 223 4/9/2021
0.1.0-alpha.17 241 4/9/2021
0.1.0-alpha.16 246 4/9/2021
0.1.0-alpha.14 228 4/9/2021
0.1.0-alpha.13 213 4/8/2021
0.1.0-alpha.12 404 4/5/2021

Add possibility to set objects as payload for Post, Put and Patch http assert calls