예제 #1
0
        public void CreateTask()
        {
            int intParenTaskId = 3;

            IRepository <ParentTask>         ParenttaskRepository = new Repository <ParentTask>();
            IRepository <ProjectDetails>     projectRepository    = new Repository <ProjectDetails>();
            IRepository <UserDetails>        userRepository       = new Repository <UserDetails>();
            IRepository <ProjectTaskDetails> taskRepository       = new Repository <ProjectTaskDetails>();

            IParentTaskDetailsBL parentTaskBusiness = new ParentTaskDetailsBL(ParenttaskRepository);
            IProjectDetailsBL    projectBusiness    = new ProjectDetailsBL(projectRepository, userRepository, taskRepository);



            TaskDetailsBL PDBL = new TaskDetailsBL(taskRepository, parentTaskBusiness, projectBusiness, userRepository);

            var Input = GetTaskInPut();

            Input.IsParentTask = false;
            if (Input != null)
            {
                PDBL.SaveTaskDetils(Input);
            }
            var TaskDetailList = PDBL.GetAllTaskDetails();
            var qq             = TaskDetailList.Where(tt => tt.TaskId == intParenTaskId);

            if (qq != null)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
예제 #2
0
        public void Setup(BenchmarkContext context)
        {
            EmployeeId   = 12345;
            SaveIter     = 20;
            deleteUserId = 10;
            fetchUserId  = 10;

            IRepository <ProjectTaskDetails> projectRepository    = new Repository <ProjectTaskDetails>();
            ParentTaskDetailsBL          parentTaskBusiness       = new ParentTaskDetailsBL(new Repository <ParentTask>());
            IRepository <TaskViewModel>  taskRepository           = new Repository <TaskViewModel>();
            IRepository <ProjectDetails> projectDetailsRepository = new Repository <ProjectDetails>();
            IRepository <UserDetails>    userRepository           = new Repository <UserDetails>();
            ProjectDetailsBL             projectDetails           = new ProjectDetailsBL(projectDetailsRepository, userRepository, projectRepository);

            taskDetailsBL = new TaskDetailsBL(projectRepository, parentTaskBusiness, projectDetails, userRepository);

            IRepository <ProjectDetails>     projectRepository1 = new Repository <ProjectDetails>();
            IRepository <UserDetails>        userRepository1    = new Repository <UserDetails>();
            IRepository <ProjectTaskDetails> taskRepository1    = new Repository <ProjectTaskDetails>();

            projectDetailsBL = new ProjectDetailsBL(projectRepository1, userRepository1, taskRepository1);
        }
예제 #3
0
        public void GetTaskDetailById()
        {
            int intTaskId = 3;

            IRepository <ParentTask>         ParenttaskRepository = new Repository <ParentTask>();
            IRepository <ProjectDetails>     projectRepository    = new Repository <ProjectDetails>();
            IRepository <UserDetails>        userRepository       = new Repository <UserDetails>();
            IRepository <ProjectTaskDetails> taskRepository       = new Repository <ProjectTaskDetails>();

            IParentTaskDetailsBL parentTaskBusiness = new ParentTaskDetailsBL(ParenttaskRepository);
            IProjectDetailsBL    projectBusiness    = new ProjectDetailsBL(projectRepository, userRepository, taskRepository);

            TaskDetailsBL TDBL = new TaskDetailsBL(taskRepository, parentTaskBusiness, projectBusiness, userRepository);

            var TaskDetailList = TDBL.GetDetailsById(intTaskId);

            var TaskDetailListExpected = TDBL.GetDetailsById(intTaskId);

            if (TaskDetailList != null && TaskDetailListExpected != null)
            {
                if (TaskDetailList.TaskId == TaskDetailListExpected.TaskId)
                {
                    Assert.Pass();
                }
                else
                {
                    Assert.Fail();
                }
            }
            else if (TaskDetailList == null && TaskDetailListExpected == null)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
예제 #4
0
        public void CompleteTask()
        {
            IRepository <ParentTask>         ParenttaskRepository = new Repository <ParentTask>();
            IRepository <ProjectDetails>     projectRepository    = new Repository <ProjectDetails>();
            IRepository <UserDetails>        userRepository       = new Repository <UserDetails>();
            IRepository <ProjectTaskDetails> taskRepository       = new Repository <ProjectTaskDetails>();

            IParentTaskDetailsBL parentTaskBusiness = new ParentTaskDetailsBL(ParenttaskRepository);
            IProjectDetailsBL    projectBusiness    = new ProjectDetailsBL(projectRepository, userRepository, taskRepository);

            TaskDetailsBL TDBL           = new TaskDetailsBL(taskRepository, parentTaskBusiness, projectBusiness, userRepository);
            var           Input          = GetTaskInPut();
            var           TaskDetailList = taskRepository.GetRecordById(Input.TaskId);

            var TaskDetailListExpected = taskRepository.GetRecordById(Input.TaskId);

            if (TaskDetailList == null && TaskDetailListExpected == null)
            {
                Assert.Pass();
            }
            else if (TaskDetailList != null && TaskDetailListExpected != null)
            {
                if (TaskDetailList.TaskId == TaskDetailListExpected.TaskId)
                {
                    Assert.Pass();
                }
                else
                {
                    Assert.Fail();
                }
            }
            else
            {
                Assert.Fail();
            }
        }