public async Task CreatePerson_WhenPostValidData_ShouldReturnNoContent()
        {
            // Arrange
            var person = new PersonContract {
                FirstName = "Name4", LastName = "LastName4", Age = 35
            };

            // Act
            var postResult = await Client.PostAsync("api/persons", new StringContent(JsonConvert.SerializeObject(person), Encoding.UTF8, "application/json"));

            // Assert
            Assert.Equal(HttpStatusCode.Created, postResult.StatusCode);

            // Make sure that returned data is valid.
            var createdPerson = await postResult.Content.ReadAsAsync <PersonContract>();

            AssertSamePerson(person, createdPerson);

            // Now get the person from API to make sure it was created.
            var getResult = await Client.GetAsync($"api/persons/{createdPerson.Id}");

            Assert.True(getResult.IsSuccessStatusCode);

            var receivedPerson = await getResult.Content.ReadAsAsync <PersonContract>();

            AssertSamePerson(person, receivedPerson);
        }
 private static void AssertSamePerson(PersonContract p1, PersonContract p2)
 {
     Assert.Equal(p1.FirstName, p2.FirstName);
     Assert.Equal(p1.LastName, p2.LastName);
     Assert.Equal(p1.Age, p2.Age);
 }