Here's my scenario - coding in C# using NUnit, I have these tests:
- Test1
- Test2
- Test3
- Test4
- TestX
The first four of these tests all function independently, but I need TestX to act a little differently. This test will need to function differently depending on which of the previous tests I've just run.
For instance, if I choose to run Test1, Test2 and TestX all in one run then TestX will act in one way, but if I instead run Test3, Test4 and then TestX, it would act differently. I'm hoping there's a way of accessing which tests have been used in a particular run and feed that into a switch statement to change TestX accordingly.
Clarification: I don't need TestX to know the results of the first four test or anything about how they ran, just simply whether they have been run or not. Also, when I say refer to a single "test run", I mean CTRL clicking several tests in the Test Explorer and then running them all in one go.
I can't seem to access this information from the TestContext, but I'm really hoping that there's another way that I've yet to think of. Any help would be appreciated - thanks very much.