using System.Threading;
using NUnit.Framework;
//[assembly: Apartment(ApartmentState.STA)]
namespace STATests
{
public class Tests
{
[Test]
public void Test1()
{
Assert.Pass();
}
}
}
dotnet test
. My project uses an entirely different, non-MSBuild-based build system, and a separate console runner tool would be, by far, the best option to integrate with that build system.
dotnet test
(and using the nunit-adapter)@all I'd like to call attention to nunit/nunit-console#1045 which proposes eliminating the NUnit.ConsoleRunner.NetCore package.
If you're a user of that package, please comment... preferably on the issue itself, but feel free to ask questions here as well.
The NUnit.ConsoleRunner.NetCore package was developed at a time when the NUnit3 console runner (NUnit.ConsoleRunner)
was not capable of running .NET core tests. Now that that is no longer the case, maintaining two runners seems like an
unnecessary effort.
Hello, have a question.
I have lots of parameterized tests that use TestCaseSource.
All these tests have different categories, properties(smoke...)
For my reporting(ExtentReport) I want to tag tests with corresponding test categories, for that, I'm trying to access my categories via TestContext. In code it looks like:
var testCategories = TestContext.CurrentContext.Test.Properties["Category"];
But for my parametrized tests I don't receive any category. For non-parameterized tests, it works just fine.
Can someone help me with that? Any workaround?
CategoryAttribute
is on a parametric test and not on the test itself - so the category is on the parent of the test. Most users find this surprising - see e.g. nunit/nunit#1358 or nunit/nunit#548 - but this is how NUnit behaves at the moment. Hopefully, we can change this for version 4, but so far it has been unresolved for a long time.
TeamCity.VSTest.TestAdapter
(source and documentation is at https://github.com/JetBrains/TeamCity.VSTest.TestAdapter)? Even though it has VSTest in it's name it also works with NUnit.