【记录】xUnit for vs2012/vs2013

简介:

  测试示例代码:

复制代码
 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 using Xunit;
 6 
 7 namespace DemoTests
 8 {
 9     public class Test
10     {
11         [Fact]
12         public void TestMethod()
13         {
14             Assert.Equal("1", "1");
15         }
16     }
17 }
复制代码

  xUnit 的使用很简单,不像 NUint 需要在测试类前加 TestFixture 标记,而只需要在测试方法前加 Fact 标记就可以了,其他的使用方法(比如断言)和 NUint比较类似。

  关于 xUnit 在 vs2012/vs2013 中的使用,只需要安装“NUnit Test Adapter”即可,使用方法和 NUint 类似,“NUnit Test Adapter”目前支持以下测试框架:

  • NUnit
  • xUnit.net
  • MbUnit
  • QUnit
  • Jasmine 

  “NUnit Test Adapter”的安装使用,可以参照:http://www.cnblogs.com/xishuai/p/3728576.html#xishuai_h4_3

  在生成解决方案后,会自动检测解决方案中所包含的测试用例:

  vs2013 需要安装:https://xunit.codeplex.com/releases

  就记录到这里。



本文转自田园里的蟋蟀博客园博客,原文链接:http://www.cnblogs.com/xishuai/p/xUnit_NUnit_vs2012_vs2013.html,如需转载请自行联系原作者

相关文章
|
7月前
|
C# Windows
[记录]c#.net framework 4.5调用运行时库
[记录]c#.net framework 4.5调用运行时库
SAP QM 事务代码QAC2的BUG?
SAP QM 事务代码QAC2的BUG?
SAP QM 事务代码QAC2的BUG?

热门文章

最新文章