public async Task Given_CreateCustomerOrderCommand_Expect_OrderResponse() { // Arrange var createCustomerOrderCommand = new CreateOrderCommand("Testing command"); _factory.Seed <Startup, MicroserviceDbContext>(db => { db.Clear(); }); // Act var response = await _client.PostAsJsonAsync(PathBuilder("orders"), createCustomerOrderCommand); Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.Created)); var result = response.Content.Deserialize <OrderResponse>().Result; // Assert StringAssert.AreEqualIgnoringCase(createCustomerOrderCommand.Name, result.Name); }