So - I have a set of tests that test something - They are sensitive to the current environment - so testing locally tests locally - testing on the build machine tests the deployed server.
However I want to have one method locally that allows me to call the deployed server - but of course I don't want it to run if I run all the local tests - and I don't want it to run on the build machine - I only want it to run when it is the only test being run
ie: I want have something like the following code
[Fact]
public void TestA()
{
}
[FactAlone]
public void TestB()
{
}
[Fact]
public void TestC()
{
}
and if I go into resharper or vs test runner, I see that they are all tests - and if I right click and say "run all" - it runs A and C.... but if I right click on B and say run test - I want B to run.
I tried to make a custom fact attribute and a custom IXunitTestCaseDiscoverer... but to make it work I need to know the complete set of tests that will be run - and that wasn't available in the discoverer. I know I could probably do it it if every attribute was mine - but this is a big codebase, and I can't stop people using "Fact", so that's not an option.
at the moment I just comment out the fact, and then uncomment it when I want to run it - which is of course a terrible solution.