Example #1
0
        public void GetTaskById_ThroughputMode(BenchmarkContext context)
        {
            //Arrange
            getTaskByIdCounter = context.GetCounter(GetTaskByIdCounterName);
            var projectManagerContext = new TestProjectManagerContext();
            var testController        = new PerTestTaskController();

            testController.Tasks().ForEach(x =>
            {
                projectManagerContext.Tasks.Add(x);
            });


            //Act
            var     controller = new TaskController(projectManagerContext);
            dynamic result     = controller.GetTaskById(1);

            getTaskByIdCounter.Increment();
        }
Example #2
0
        public void EndTask_ThroughputMode(BenchmarkContext context)
        {
            //Arrange
            endTaskCounter = context.GetCounter(EndTaskCounterName);
            var projectManagerContext = new TestProjectManagerContext();
            var testController        = new PerTestTaskController();

            testController.Tasks().ForEach(x =>
            {
                projectManagerContext.Tasks.Add(x);
            });

            var task = new Task()
            {
                TaskId = 1
            };

            //Act
            var     controller = new TaskController(projectManagerContext);
            dynamic result     = controller.EndTask(task.TaskId);

            endTaskCounter.Increment();
        }
Example #3
0
        public void UpdateTask_ThroughputMode(BenchmarkContext context)
        {
            //Arrange
            updateTaskCounter = context.GetCounter(UpdateTaskCounterName);
            var projectManagerContext = new TestProjectManagerContext();
            var testController        = new PerTestTaskController();

            testController.Tasks().ForEach(x =>
            {
                projectManagerContext.Tasks.Add(x);
            });

            var task = new Task()
            {
                TaskId = 2, TaskName = "FS1", Priority = 5, StartDate = new DateTime(2018, 10, 1), EndDate = new DateTime(2018, 10, 2)
            };

            //Act
            var     controller = new TaskController(projectManagerContext);
            dynamic result     = controller.UpdateTask(task);

            updateTaskCounter.Increment();
        }