Search code examples
c#unit-testingfiddlerowin

Microsoft.Owin.Testing.TestServer cannot use with Fiddler


I tried to use TestServer and found that Fiddler could not catch the traffic.

The address is set to http://localhost and no way to change it.

        server = TestServer.Create(app =>
        {
            new Startup().Configuration(app);
        });

It would be good to change the url to http://ipv4.fiddler or some other candidate methods in http://docs.telerik.com/fiddler/observe-traffic/troubleshooting/notraffictolocalhost page.

how can I do?


Solution

  • This won't work as TestServer fakes out the transport layer and just creates and passes in HttpContext objects to your controllers. There's no traffic for Fiddler to intercept and no real TCP or HTTP performed.