Testing HttpClient the Right Way: Mock Handlers, Not Interfaces
Hey test-loving developers! ๐ I see this pattern ALL the time: // โ The wrong way public interface IHttpClientWrapper { Task < T > GetAsync < T >( string url ); Task < T > PostAsync < T >( string url , object data ); } Stop wrapping HttpClient ! There's a much better way to test HTTP calls. Let me show you! The Problem with Wrapper Interfaces You're testing your wrapper, not real behavior โโฆ
We haven't written up this one. Dev.to has the full story โ the link below goes straight to it.