public virtual async void TestDelete() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IBadgeService service = testServer.Host.Services.GetService(typeof(IBadgeService)) as IBadgeService; var model = new ApiBadgeServerRequestModel(); model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), "B", 1); CreateResponse <ApiBadgeServerResponseModel> createdResponse = await service.Create(model); createdResponse.Success.Should().BeTrue(); ActionResponse deleteResult = await client.BadgeDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiBadgeServerResponseModel verifyResponse = await service.Get(2); verifyResponse.Should().BeNull(); }