Exemplo n.º 1
0
        public void Test_ProjectGet(string projectName, int ProjectID)
        {
            var controller = new ProjectAPIController();

            List <ProjectDetailModel> resoponse = controller.Get();
            var result = resoponse.Where(t => t.PDProjectID == ProjectID).FirstOrDefault();

            Assert.AreEqual(projectName, result.PDProjectName);
        }
Exemplo n.º 2
0
        public void Test_ProjectPost(ProjectModel projectModel)
        {
            var controller = new ProjectAPIController();

            controller.Post(projectModel);
            List <ProjectDetailModel> resoponse = controller.Get();
            var result = resoponse.Where(t => t.PDProjectID == projectModel.Project_ID).FirstOrDefault();

            Assert.AreEqual(projectModel.Project, result.PDProjectName);
        }
Exemplo n.º 3
0
        public void Test_ProjectDelete(int ProjectID)
        {
            var controller = new ProjectAPIController();
            List <ProjectDetailModel> resoponse = controller.Get();
            var          result  = resoponse.Where(t => t.PDProjectID == ProjectID).FirstOrDefault();
            ProjectModel project = new ProjectModel()
            {
                UserID     = result.UserID,
                Priority   = result.PDPriority,
                Project    = result.PDProjectName,
                Project_ID = result.PDProjectID,
                StartDate  = result.PDStartDate,
                EndDate    = result.PDEndDate
            };

            controller.Delete(project);
            List <ProjectDetailModel> resoponse2 = controller.Get();
            var result2 = resoponse2.Where(t => t.PDProjectID == ProjectID).FirstOrDefault();

            Assert.That(result2, Is.Null);
        }
Exemplo n.º 4
0
        public void Test_ProjectPut(string projectName, int Project_ID)
        {
            var controller = new ProjectAPIController();
            List <ProjectDetailModel> resoponse = controller.Get();
            var          result  = resoponse.Where(t => t.PDProjectID == Project_ID).FirstOrDefault();
            ProjectModel project = new ProjectModel()
            {
                UserID     = result.UserID,
                Priority   = result.PDPriority,
                Project    = projectName,
                Project_ID = result.PDProjectID,
                StartDate  = result.PDStartDate,
                EndDate    = result.PDEndDate
            };

            controller.Put(project);
            List <ProjectDetailModel> resoponse2 = controller.Get();
            var result2 = resoponse2.Where(t => t.PDProjectID == Project_ID).FirstOrDefault();

            Assert.AreEqual(projectName, result2.PDProjectName);
        }