Question

I've written 6 tests using Xunit for the first time.

[Fact] 
public void test_1()...
[Fact] 
public void test_2()...
[Fact] 
public void test_3()...
[Fact] 
public void test_4()...
[Fact] 
public void test_5()...
[Fact] 
public void test_6()...

Following this post Can Visual Studio 2010 Test Runner run XUnit? I was able to add the xunit console as an external tool in VS 2010.

However, when I click on the Xunit Test menu item I get the following results, shouldn't it say Tests complete : 6 of 6? why is it saying 1 of 1?

xUnit.net console test runner (64-bit .NET 4.0.30319.296)
Copyright (C) 2007-11 Microsoft Corporation.

xunit.dll:     Version 1.9.1.1600
Test assembly: C:\Users\...\MyProject-MVC\MyProject.Tests\bin\Debug\MyProject.Tests.dll

Tests complete: 1 of 1
1 total, 0 failed, 0 skipped, took 0.311 seconds
Was it helpful?

Solution

@rubenbartelink 's answer was the correct one. My main test class was private, in other words, it wasn't explicitly public.

Details: Why is the xUnit Runner not finding my tests

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top