public void Can_Create_A_New_Student() { endPoint = _baseUrl; Student postData = new Student() { FirstName = "testFirstName", LastName = "testLastName", Email = "*****@*****.**", Phone = "3939992222", isActive = true }; var jsonData = JsonConvert.SerializeObject(postData); headers.Add("content-type", "application/json"); var result = API_Helper.PostRequest(endPoint, headers, jsonData); Assert.AreEqual(HttpStatusCode.Created, result.StatusCode); var fromDB = _studentDbContext.Students.OrderByDescending(s => s.StudentId).FirstOrDefault(); postData.StudentId = fromDB.StudentId; Assert.IsTrue(postData.stEquals(fromDB)); //clean up the test data // _studentDbContext.Students.ToList().RemoveAll(s => s.Email == "*****@*****.**"); }