XFE各类拓展.NetCore.XUnit
1.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package XFE各类拓展.NetCore.XUnit --version 1.0.3
NuGet\Install-Package XFE各类拓展.NetCore.XUnit -Version 1.0.3
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="XFE各类拓展.NetCore.XUnit" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XFE各类拓展.NetCore.XUnit --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XFE各类拓展.NetCore.XUnit, 1.0.3"
#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.
// Install XFE各类拓展.NetCore.XUnit as a Cake Addin #addin nuget:?package=XFE各类拓展.NetCore.XUnit&version=1.0.3 // Install XFE各类拓展.NetCore.XUnit as a Cake Tool #tool nuget:?package=XFE各类拓展.NetCore.XUnit&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
XFE各类拓展.NetCore.XUnit
描述
XUnit测试框架,使得用户不需要编写Main函数,只需要在需要测试的类或者方法上面加上相对于的特性即可。
示例
快速编写无参测试用例
using System;
using XFE各类拓展.NetCore.XUnit;
[CTest]
//[CTest]
//可添加多个测试用例
public class TestClass
{
[MTest]
//[MTest]
//[MTest]
//可添加多个测试用例
public void TestMethod()
{
Console.WriteLine("Hello World!");
}
}
带参数的测试用例
using System;
using XFE各类拓展.NetCore.XUnit;
[CTest]
public class TestClass
{
[MTest]
[MTest(1, 2)]
[MTest(2, 3)]
[MTest(3, 4)]
public void TestMethod(int a, int b)
{
Console.WriteLine(a + b);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- XFE各类拓展.NetCore (>= 1.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
删除生成的代码中冗余的using