This project is read-only.

How can I verify if a new header has been added?

Jan 2, 2012 at 6:42 AM

WCFMock is pretty awesome. But I've just hit a roadblock writing a unit test for a piece of code that adds a custom HTTP header. Effectively what happens is a new item is added to the WebHeaderCollection. But I cannot verify this on the mock because WebHeaderCollection.Add is not virtual. The other option is

MockedWebOperationContext.Current.OutgoingResponse.Headers

But this is returning zero items in the headers collection. Am I expecting something wrong here?

MockedWebOperationContext.Current.OutgoingResponse.Headers