Skip to content

CUnit is short for Contracted Unit Test which means you only specify the contracts of a method then you can get the unit test results of the contracts. (或者你也可以称 Chinese Unit Test)

License

Notifications You must be signed in to change notification settings

dotnet-campus/CUnit

Repository files navigation

English 日本語 简体中文 繁體中文

.NET Build & Test NuGet Push

Name NuGet
MSTestEnhancer
dotnetCampus.UITest.WPF

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

About

CUnit is short for Contracted Unit Test which means you only specify the contracts of a method then you can get the unit test results of the contracts. (或者你也可以称 Chinese Unit Test)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages