NUnit doesn't find tests in assembly

时间秒杀一切 提交于 2019-12-01 08:52:36

Check:

  • Is the class public?
  • Does it have a public parameterless constructor (e.g. the default one if you don't specify any other constructors)
  • Does it have the [TestFixture] attribute at the class level?
  • Is each test public?
  • Does each test have the [Test] attribute?
  • Is each test parameterless?

I believe some versions of NUnit were able to find tests based on their names, e.g. TestFooBarBaz() without the [Test] attribute, but I don't know what the state of this is now - it could explain the discrepancy though.

Grzenio

Thanks for help, everyone. Upgrading to the latest NUnit framework fixed the problem (all the obvious things you suggested were OK).

Frederik Gheysels, you can try that as well I guess.

Are your test fixtures, classes and methods, public? They have to be for NUnit to find them.

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