ReSharper的单元测试不运行 [英] Resharper Unit Tests not running
问题描述
我想开始一个项目编写单元测试。我第一次写了的CreateTest和尝试。该测试通过,我开始写我的其他测试。
I'm trying to get started writing unit tests in a project. I wrote the createTest first and tried it. This test passed and I started writing my other tests.
现在我所有的测试只是说测试无法运行。这种情况既当我试图同时运行所有测试,当我运行一个测试。
Now all my tests just say "Test not run". This happens both when I try to run all tests at once and when I run a single test.
的 https://github.com/Requinard/OperationOctopus/tree/UnitTest
我的一切。迄今发现的使用NUnit的人。我们使用默认的微软测试框架,与ReSharper的运行测试。
All I've found so far is people using NUnit. We're using the default microsoft testing framework, with resharper running the tests.
[TestMethod]
public void CreateTest()
{
Init.Initialize();
// set up
UserModel user = new UserModel();
user.Address = "Testing Street 1";
user.Email = "Testing@test.com";
user.Level = 2;
user.Password = "test";
user.RfiDnumber = "00d0wad0aw";
user.Telephonenumber = "0638212327";
user.Username = "testcaseuser";
Assert.IsTrue(user.Create(), "Cannot write user to database");
test_user = user;
}
[TestMethod]
public void ReadTest()
{
Init.Initialize();
// set up
UserModel user = getTestUser();
Assert.AreEqual(user.Email, test_user.Email, "Reading returned an unexpected result");
}
[TestMethod]
public void AlterTest()
{
Init.Initialize();
UserModel user = getTestUser();
user.Email = "test@testing.com";
Assert.IsTrue(user.Update(), "Failure during updating");
user.Read();
Assert.AreNotEqual(user.Email, test_user.Email);
}
[TestMethod]
public void DestroyTest()
{
Init.Initialize();
UserModel user = getTestUser();
Assert.IsTrue(user.Destroy(), "Could not destroy user");
}
上面的测试将让ReSharper的说:测试不运行
The above tests will make resharper say "Test not run"
我只是试图运行我的笔记本电脑的测试。他们的工作没有任何改变代码和测试瞬间完成。这使我觉得我处理的是一个错误的配置的地方。
I just tried running the tests on my laptop. They worked without any changes to the code and the test completed instantly. This leads me to think I'm dealing with a faulty config somewhere.
推荐答案
这似乎有一个坏的config /地方/ 。我重新安装整个sysetm,其次是VS2013和R#。测试运行现在罚款。
It seems there was a bad config /somewhere/. I reinstalled the entire sysetm, followed by VS2013 and R#. The tests now run fine.
这篇关于ReSharper的单元测试不运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!