A unit test for a method that takes a Stream
How would you write a unit test for a method that accepts a file stream and returns a byte array? Or a method that takes a file stream (of an image) and resizes it?
Does the unit test project need to have a dummy file always-at-hand for this (that's what I'm doing right no)? I somehow don't find this to be a very... appealing solution. So I'm wondering if you guys have another way that you use.
Re: A unit test for a method that takes a Stream
If your method accepted a Stream rather than a FileStream, then you could pass it a MemoryStream during testing instead.
That said, you can't always generalise and abstract your tests from your application. Having an image file in the test project may be the best way to go.