public async Task Returns_expected_response() { // Arrange var client = new SelfContainedWebApplicationFactoryWithWebHost <Delete_with_2_handlers> ( configureServices: services => { services.AddViewModelComposition(options => { options.AssemblyScanner.Disable(); options.RegisterCompositionHandler <TestStringHandler>(); options.RegisterCompositionHandler <TestIntegerHandler>(); options.EnableWriteSupport(); }); services.AddRouting(); }, configure: app => { app.UseRouting(); app.UseEndpoints(builder => builder.MapCompositionHandlers()); } ).CreateClient(); client.DefaultRequestHeaders.Add("Accept-Casing", "casing/pascal"); // Act var response = await client.DeleteAsync("/sample/1"); // Assert Assert.True(response.IsSuccessStatusCode); var responseString = await response.Content.ReadAsStringAsync(); var responseObj = JObject.Parse(responseString); Assert.Equal(expectedString, responseObj?.SelectToken("AString")?.Value <string>()); Assert.Equal(expectedNumber, responseObj?.SelectToken("ANumber")?.Value <int>()); }