CUnit
CUnit copied to clipboard
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)
English | 日本語 | 简体中文 | 繁體中文 |
---|
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:
For more usages, please visit:
- English
- 日本語
- 简体中文
- 繁體中文
Contributing Guide
There are many ways to contribute to MSTestEnhancer
- Submit issues and help verify fixes as they are checked in.
- Review the documentation changes.
- How to Contribute
License
MSTestEnhancer is licensed under the MIT license