如何为Visual Studio 2015 RC / .NET Core项目创建单元测试?

时间:2022-10-30 16:33:51

I've just started to play around with the new Visual Studio 2015 RC but I've run into a problem in that I can't seem to find an example project that shows how to unit-test the new .NET COre code. An example or even being pointed in the right direction would be very helpful. Thanks....

我刚刚开始使用新的Visual Studio 2015 RC,但我遇到了一个问题,我似乎无法找到一个示例项目,展示如何对新的.NET COre代码进行单元测试。一个例子或甚至指向正确的方向将是非常有帮助的。谢谢....

1 个解决方案

#1


You should have a look at xUnit, it was written by the author of nUnit, it's compatible with all of the new vNext goodness (Asp.Net 5, Universal Apps, and Xamirin, CoreClr) and it's what the tests for MVC vNext are written in. It also works with nCrunch.

您应该看一下xUnit,它是由nUnit的作者编写的,它与所有新的vNext优点(Asp.Net 5,Universal Apps和Xamirin,CoreClr)兼容,并且它是用于编写MVC vNext的测试的内容in。它也适用于nCrunch。

You can install it from nuget.

你可以从nuget安装它。

#1


You should have a look at xUnit, it was written by the author of nUnit, it's compatible with all of the new vNext goodness (Asp.Net 5, Universal Apps, and Xamirin, CoreClr) and it's what the tests for MVC vNext are written in. It also works with nCrunch.

您应该看一下xUnit,它是由nUnit的作者编写的,它与所有新的vNext优点(Asp.Net 5,Universal Apps和Xamirin,CoreClr)兼容,并且它是用于编写MVC vNext的测试的内容in。它也适用于nCrunch。

You can install it from nuget.

你可以从nuget安装它。