Hi Pat,
If you were able to know which hardware was to be used by a run, the
easiest approach would be to use Categories on the tests. Then the
run on a particular test server could include only the categories that
apply to the hardware it was going to check out.
However, it sounds like you need to do it after the run starts, with
the tests themselves detecting what's available. In that situation,
you can use one of several runtime actions:
1) Simply not executing the test code or using Assert.Pass, which
will make the test succeed. This is a bit of a misrepresentation,
since you haven't actually run the test. Assert.Pass does have
a message associated with it but it's not currently reported
in any useful way (like in the XML) so that won't help you.
2) Make an assertion, causing the test to fail. I guess this is
what you do now, with the disadvantage that you have to filter
the "failures" manually.
3) Use Assert.Ignore, causing it to be ignored. This would give
you a yellow bar in the gui and a list of ignored tests in the
console runner. You should still go through the list, in order
to make sure that there are not other ignored tests that need
to be dealt with.
4) Use Assert.Inconclusive directly or better yet Assume.That to
give you an inconclusive result. This does not affect the overall
outcome of the run and does not clutter your results with messages
so it seems like a likely candidate right now. The test in your
case isn't truly inconclusive but more like "undetermined" but
that seems like a minor point. We may end up reporting inonclusive
tests at a later point, but probably only as an option.
5) It seems to me that the ideal (but not yet available) solution
for your case would be to allow you to extend the platform attribute
to specify your own hardware together with your own detection
routine. Then it would work just like a test that is intended to
run only on a specific operating system. Unfortunately, we don't
have that yet.
So for now, I suggest #4. You could code it in the test itself
or, where applicable, in the SetUp or TestFixtureSetUp as
Assume.That( RequiredHardwareIsAvailable(), "some message");
Charlie