I'm aware that unit tests should be completely independent of one another, meaning that the order of operations should never be important.
How do you handle a scenario where you have test that loads a large document over the network, yet needs other tests to verify information on said document?
I do not want the document requested for each test that has to check this or that.
It works fine if the document is stored as a static member of the test class, and the initial test that fetches it runs first. Then the subsequent tests can all do their own thing with the cached copy.
But, again, order of operations with unit tests is wrong, as they should be independent.
What is the best practice in this case? I'd prefer to have them all as separate tests and not rolled into one single, big test that can assert all sorts of things about the document after it's been fetched.
My current scenario is Visual Studio 2015 Update 3 and C#, but I guess it can be applied to any similar setup.
In Visual Studio's test runner, you can set up "playlists" that will let you run them in an order, but it still feels wrong.
Edit: I'm leaning towards the static approach, in which case each test has to get the document via a single method. I guess a singleton-type approach (if null, go and get it, otherwise return it).
But any feedback is good.