You could check whether the test was explicitly selected. We don't have a convenient way to do this right now (suggest an API in our issue tracker) but the following snippet should work:
bool isExplicit = PatternTestState.FromContext(TestContext.CurrentContext).IsExplicit; Jeff. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of alunharford Sent: Thursday, October 01, 2009 5:30 AM To: MbUnit.User Subject: MbUnit TestContext and which tests are being run Hi all, I'm using MbUnit and Gallio to run my acceptance tests with WatiN. At the moment, I can either choose to make the browser instance visible (which is annoying when you're running the whole test suite - particularly if they're run in parallel) or not (which makes debugging more difficult if you're only running one acceptance test). I'd like to only show the browser window if the tests being run are from a single fixture. Examining TestContext seems to return all the tests in the assembly, whether or not they're going to run. Is there a way to find out which tests are actually going to be executed in this test run? Alun Harford --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MbUnit.User" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mbunituser?hl=en -~----------~----~----~----~------~----~------~--~---
