Example #1
0
        public void Get_Test()
        {
            //arrange
            TestRepository db = new TestRepository();

            PatientDemog.Controllers.PatientsController controller = new Controllers.PatientsController(db);
            //action
            IEnumerable <Patient> list = controller.Get();

            //asset
            Assert.IsNotNull(list);
        }
Example #2
0
        public void Put_Test()
        {
            //arrange
            TestRepository db = new TestRepository();

            PatientDemog.Controllers.PatientsController controller = new Controllers.PatientsController(db);
            Patient patient = Factory.CreatePatient();

            patient.FirstName        = "Jason";
            patient.LastName         = "Coy";
            patient.Gender           = "Female";
            patient.BirthDate        = new DateTime(2000, 1, 2);
            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();
            //action
            HttpResponseMessage ret = controller.Post(patient);

            //

            Assert.AreEqual(ret.StatusCode, HttpStatusCode.Created);
        }