public void PostTestMethod() { PatientController controllerObject = new PatientController(new PatientServices()); Patient patientData = new Patient() { PatientId = Guid.NewGuid().ToString(), FirstName = "first", LastName = "last", Gender = "Male", DateOfBirth = DateTime.Now, Phone = new TelephoneNumber() { HomePhone = 99999999, WorkPhone = 888888, CellPhone = 77777 } }; var h = controllerObject.Add(patientData) as OkNegotiatedContentResult <System.String>;; Assert.AreEqual(h.Content.ToLower(), "data posted successfully"); }