public void E110_PatchPostCodes_MockHttpClient_ETagError() { var mcf = MockHttpClientFactory.Create(); var mc = mcf.CreateClient("zippo", new Uri("http://api.zippopotam.us/")); mc.Request(HttpMethod.Get, "US/WA/Redmond").Respond.WithJsonResource("B140_GetPostCodes_MockedHttpClient_Found.json"); using var agentTester = Beef.Test.NUnit.AgentTester.CreateWaf <Startup>(sc => mcf.Replace(sc)); var res = agentTester.Test <PostalInfoAgent, PostalInfo>() .ExpectStatusCode(HttpStatusCode.OK) .Run(a => a.GetPostCodesAsync("US", "WA", "Redmond")); res = agentTester.Test <PostalInfoAgent, PostalInfo>() .ExpectStatusCode(HttpStatusCode.PreconditionFailed) .Run(a => a.PatchPostCodesAsync(WebApiPatchOption.MergePatch, TestSetUp.GetResourceStream("E110_PatchPostCodes_Request.json").ReadToEnd(), "US", "WA", "Redmond")); }