NUnit Integration With Microsoft Test Manager

我的未来我决定 提交于 2019-12-04 17:11:41

We were able to pick up our NUnit tests fine using tcm to import to MTM, by adding a TestMethodAttribute to our NUnit test methods.

For example:

namespace NUnit.Tests
{
  using NUnit.Framework;

  [TestFixture]
  public class SuccessTests
  {
    [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod] //<-- here
    [Test] 
    public void Add()
    { 
      //
    }
  }
}

Using the fully-qualified reference to TestMethod was preferred over a using directive, since several of the class names clash between either implementation so this would introduce an ambiguity.

With the above in place, we were then able to successfully call tcm.exe to import these tests:

tcm testcase /import /collection:CollectionURL /teamproject:project /storage:path

No, your tests need to be in the MSTest framework in order to be integrated with the Microsoft Test Manager. If you want to use MTM you need to convert your NUnit Test cases into MSTests. You can refer this URL in order to achieve this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!