I have a unit test for an Http handler. In it, I create an HttpResponse object and pass it to one of the methods of the Http handler.
One of my tests is trying to verify that the response headers are set correctly:
Assert.AreEqual( "gzip", response.Headers["Content-Encoding"]);
However, the Headers property throws a PlatformNotSupportedException with the message "This operation requires IIS pipeline integrated mode .
The strange thing is, as I understand it, this exception is related to the response headers - without reading them. I use TDD, so I do not set the headers anywhere (yet), but still I get an exception.
Why am I getting this exception and is there a good or better way for unit test response headers?
source share