Search code examples
c#.netvisual-studio-2012microsoft-fakes

Can I fake HttpContent.ReadAsAsync<T>?


Is it possible to create a stub that implements HttpContent.ReadAsAsync<T> with the help of Microsoft Fakes (in Visual Studio 2012)? If so, how?


Solution

  • HttpContent.ReadAsAsync<T> cannot be stubbed in VS2012. Reason being that this is not a virtual method but an extension method. Only virtual interface/class method can be stubbed.