单元测试不适用于VS2010

时间:2014-06-11 13:41:41

标签: visual-studio-2010 unit-testing

我创建了一个简单的单元测试项目,我在其中添加了简单的测试函数来返回字符串。但是,当我生成单元测试项目并尝试运行测试方法时,Control永远不会返回给我。我必须关闭VS,因为这永远不会停止。请看截图。

public class Class1
{
    public string Test()
    {
        return "testing";
    }
}

添加了测试方法

    [TestMethod()]
    public void TestTest()
    {
        Class1 target = new Class1(); // TODO: Initialize to an appropriate value
        string expected = string.Empty; // TODO: Initialize to an appropriate value
        string actual;
        actual = target.Test();
        Assert.AreEqual(expected, actual);
        Assert.Inconclusive("Verify the correctness of this test method.");
    }

VS继续运行此测试功能,永远不会返回控件。 enter image description here

这可能是什么原因。它是VS中的错误还是VS或其他版本之间的冲突。

请注意:此测试项目在VS 2010上运行。我也安装了VS 2012。

0 个答案:

没有答案
相关问题