我正在使用MSTest.TestFramework
。
我看到了这个问题(此链接没有解决方案): https://resharper-support.jetbrains.com/hc/en-us/community/posts/360000057490-Unit-Test-Sessions-reports-Inconclusive-Test-not-run-?page=2#comments
当我尝试运行此测试时,它给出了该错误:
using System;
using Moq;
using System.Reflection;
using NUnit.Framework;
namespace Tests
{
[TestClass()]
public class MyTests
{
[TestInitialize]
public void setup()
{
System.Diagnostics.Debug.WriteLine("Just a simple test");
}
[TestMethod()]
public void testOne()
{
string fake = "fake";
Assert.IsNotNull(fake);
}
}
}
如果我切换到NUnit,则可以正常工作!:运行没有问题:
using System;
using Moq;
using System.Reflection;
using NUnit.Framework;
namespace Tests
{
[TestFixture()]
public class MyTests
{
[SetUp]
public void setup()
{
System.Diagnostics.Debug.WriteLine("Just a simple test");
}
[Test()]
public void testOne()
{
string fake = "fake";
Assert.IsNotNull(fake);
}
}
}
如何使其与常规的.Net测试框架而不是NUnit一起使用?