public void BenchMarkSaveTask()
        {
            TaskViewModel task = new TaskViewModel
            {
                TaskName       = "Add Task from nbench",
                StartDate      = Convert.ToDateTime("01/01/2018"),
                ProjectId      = 1,
                ProjectName    = "Project-1",
                ParentTaskId   = 1,
                ParentTaskName = "P1-Task",
                Priority       = 15,
                EndDate        = Convert.ToDateTime("12/12/2018"),
                TaskId         = 0
            };

            IRepository <ProjectTask> taskRepository       = new Repository <ProjectTask>();
            IRepository <ParentTask>  parenttaskRepository = new Repository <ParentTask>();
            IParentTaskBusiness       taskbusiness         = new ParentTaskBusiness(parenttaskRepository);

            IRepository <Project> projectRepository = new Repository <Project>();
            IRepository <User>    userRepository    = new Repository <User>();
            IProjectBusiness      projectBusiness   = new ProjectBusiness(projectRepository, userRepository, taskRepository);

            TaskBusiness taskBusiness = new TaskBusiness(taskRepository, taskbusiness, projectBusiness, userRepository);

            taskBusiness.Save(task);
        }
        public void GetParentTaskThroughput_ThroughputMode(BenchmarkContext context)
        {
            ParentTaskBusiness parentTaskBusiness = new ParentTaskBusiness();
            List <ParentTask>  parentTask         = parentTaskBusiness.GetParentTasks().ToList();

            addCounter.Increment();
        }
        public void PostParentTaskTest()
        {    //Arrange
            ParentTaskBusiness parentTaskBusiness = new ParentTaskBusiness();
            ParentTask         parentTask         = new ParentTask();

            parentTask.ParentTask1 = "Parent task test";
            //Act
            parentTaskBusiness.PostParentTask(parentTask);

            //Assert
            Assert.AreNotEqual(0, parentTask.ParentId);
        }
        public void BenchMarkGetTasks()
        {
            IEnumerable <TaskViewModel> tasks;
            IRepository <ProjectTask>   taskRepository       = new Repository <ProjectTask>();
            IRepository <ParentTask>    parenttaskRepository = new Repository <ParentTask>();
            IParentTaskBusiness         taskbusiness         = new ParentTaskBusiness(parenttaskRepository);

            IRepository <Project> projectRepository = new Repository <Project>();
            IRepository <User>    userRepository    = new Repository <User>();
            IProjectBusiness      projectBusiness   = new ProjectBusiness(projectRepository, userRepository, taskRepository);

            TaskBusiness taskBusiness = new TaskBusiness(taskRepository, taskbusiness, projectBusiness, userRepository);

            tasks = taskBusiness.GetAllTasks();
        }
        public void BenchMarkGetTaskById()
        {
            TaskViewModel             task;
            IRepository <ProjectTask> taskRepository       = new Repository <ProjectTask>();
            IRepository <ParentTask>  parenttaskRepository = new Repository <ParentTask>();
            IParentTaskBusiness       taskbusiness         = new ParentTaskBusiness(parenttaskRepository);


            IRepository <Project> projectRepository = new Repository <Project>();
            IRepository <User>    userRepository    = new Repository <User>();
            IProjectBusiness      projectBusiness   = new ProjectBusiness(projectRepository, userRepository, taskRepository);

            TaskBusiness taskBusiness = new TaskBusiness(taskRepository, taskbusiness, projectBusiness, userRepository);

            task = taskBusiness.GetById(1);
        }
        public void GetParentTaskTest()
        {    //Arrange
            ParentTaskBusiness parentTaskBusiness = new ParentTaskBusiness();
            //Act
            ParentTask parentTask = parentTaskBusiness.GetParentTask(2);

            //Assert
            if (parentTask != null)
            {
                Assert.AreEqual(2, parentTask.ParentId);
            }
            else
            {
                Assert.IsNotNull(parentTask);
            }
        }