1

Tests in my unit test project which are written for WebApi's are failing.

The Exception that is thrown is 'System.InvalidProgramException' in System.Net.Http.dll Additional information: Common Language Runtime detected an invalid program.

This is thrown while initializing the request object of controller to use in tests:

        this.samplecontroller.Request = new HttpRequestMessage() { Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } } };

I'm struggling with this problem, any help would be greatly appreciated.

The .Net Framework i use is 4.6.1

Vinodh
  • 385
  • 1
  • 4
  • 15
  • Can you share the code which you are trying to unit test along with the complete unit test code? – Chetan Oct 24 '17 at 04:43

0 Answers0