MSTestEnhancer 2.2.2

dotnet add package MSTestEnhancer --version 2.2.2
                    
NuGet\Install-Package MSTestEnhancer -Version 2.2.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="MSTestEnhancer" Version="2.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MSTestEnhancer" Version="2.2.2" />
                    
Directory.Packages.props
<PackageReference Include="MSTestEnhancer" />
                    
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 MSTestEnhancer --version 2.2.2
                    
#r "nuget: MSTestEnhancer, 2.2.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.
#:package MSTestEnhancer@2.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MSTestEnhancer&version=2.2.2
                    
Install as a Cake Addin
#tool nuget:?package=MSTestEnhancer&version=2.2.2
                    
Install as a Cake Tool
English 日本語 简体中文 繁體中文

.NET Build & Test NuGet Push

Name NuGet
MSTestEnhancer alternate text is missing from this package README image
dotnetCampus.UITest.WPF alternate text is missing from this package README image

CUnit

Don't you think that naming is very very hard? Especially naming for unit test method? Read this article for more data of naming: Don’t go into programming if you don’t have a good thesaurus - ITworld.

CUnit (MSTestEnhancer) helps you to write unit tests without naming any method.

CUnit is a contract-style unit test extension for MSTestv2. You can write method contract descriptions instead of writing confusing test method name when writing unit tests.


Getting Started with CUnit

You can write unit test like this:

[TestClass]
public class DemoTest
{
    [ContractTestCase]
    public void Foo()
    {
        "When A happened, result A'.".Test(() =>
        {
            // Arrange
            // Action
            // Assert
        });

        "But when B happened, result B'".Test(() =>
        {
            // Arrange
            // Action
            // Assert
        });
    }
}

Then you'll see this kind of test result in testing explorer window:

Unit test result

For more usages, please visit:

Contributing Guide

There are many ways to contribute to MSTestEnhancer

License

MSTestEnhancer is licensed under the MIT license

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MSTestEnhancer:

Package Downloads
dotnetCampus.UITest.WPF

The UITest framework for WPF

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on MSTestEnhancer:

Repository Stars
lindexi/lindexi_gd
博客用到的代码
dotnet-campus/AsyncWorkerCollection
高性能的多线程异步工具库。A collection of tools that support asynchronous methods and support high-performance multithreading.
Version Downloads Last Updated
2.2.2 15 7/19/2025
2.2.2-alpha05 143 7/15/2025
2.2.1 1,436 10/27/2022
2.2.1-alpha01 4,646 2/21/2022
2.2.0 9,228 1/6/2022
2.1.2-alpha03 260 12/27/2021
2.1.2-alpha02 249 12/27/2021
2.1.2-alpha01 231 12/27/2021
2.1.1 1,570 8/4/2021
2.1.1-alpha02 277 8/4/2021
2.1.1-alpha01 336 8/4/2021
2.1.0 4,044 3/4/2021
2.0.2-alpha03 161 8/10/2023
2.0.2-alpha02 202 4/18/2023
2.0.1 5,293 5/24/2020
1.6.0 3,464 6/21/2018
1.4.0 1,618 3/20/2018
1.3.0 1,231 2/26/2018
1.2.1 1,208 2/24/2018
1.2.0 1,185 2/13/2018
1.1.0 1,209 2/12/2018
1.0.0 1,239 2/11/2018

Add some assersion extensions.