public async Task PostContact_Success() { // Arrange FakeDbContext db = new FakeDbContext(); var controller = new ContactsController(db); // Act var itemToInsert = TestData.Contacts.Where(c => c.ContactId == 1) .FirstOrDefault(); var result = await controller.PostContact(itemToInsert) as CreatedAtRouteNegotiatedContentResult <Contact>; var retrievedResult = db.Query <Contact>().Where(c => c.ContactId == 1) .FirstOrDefault(); // Assert Assert.IsNotNull(itemToInsert); Assert.IsNotNull(result); Assert.AreEqual(itemToInsert.EmailAddress, retrievedResult.EmailAddress, "PostContact email address comparison failed!!"); }