示例#1
0
        public void DeleteUser_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.DeleteUser(1);
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }
示例#2
0
        public void GetTasks_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.GetTasks();
            var contentResult = actionResult as OkNegotiatedContentResult <List <ProjectManagmenPortal.API.Task> >;

            Assert.IsTrue(contentResult.Content.Count >= 0);
        }
示例#3
0
        public void GetUserById_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.GetUserById(1);
            var contentResult = actionResult as OkNegotiatedContentResult <List <ProjectManagmenPortal.API.Task> >;

            Assert.IsNull(contentResult);
        }
示例#4
0
        public void GetProjects_Test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.GetProjects();
            var contentResult = actionResult as OkNegotiatedContentResult <List <Project> >;

            Assert.IsTrue(contentResult.Content.Count > 0);
        }
示例#5
0
        public void UpdateStatusOfTask_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.UpdateStatusOfTask(1);
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }
示例#6
0
        public void AddProject_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.AddProject(new Project {
                ProjectName = "TestProj", priority = 0, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(1)
            });
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }
示例#7
0
        public void AddParentTask_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.AddParentTask(new ParentTask {
                parent_task = "ParentTest"
            });
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }
示例#8
0
        public void AddTask_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.AddTask(new ProjectManagmenPortal.API.Task {
                parent_id = "1", project_ID = "1", TaskName = "TestCase", Start_Date = DateTime.Now, End_Date = DateTime.Now.AddDays(1), priority = 15
            });
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }
示例#9
0
        public void AddUser_test()
        {
            ProjectManagmentController ic           = new ProjectManagmentController();
            IHttpActionResult          actionResult = ic.AddUser(new User {
                Task_ID = "1", Employee_ID = "1", FirstName = "AB", Lastname = "CD", project_ID = "1"
            });
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }
示例#10
0
        public void UpdateTask_test()
        {
            ProjectManagmentController ic = new ProjectManagmentController();

            ProjectManagmenPortal.API.Task proj = new ProjectManagmenPortal.API.Task {
                Start_Date = DateTime.Now, End_Date = DateTime.Now.AddDays(2), priority = 13, Status = "Completed"
            };
            IHttpActionResult actionResult = ic.UpdateTask(proj);
            var contentResult = actionResult as OkResult;

            Assert.IsNotNull(contentResult);
        }