public void GetAllProjects_ThroughputMode(BenchmarkContext context) { //Arrange getAllProjectsCounter = context.GetCounter(GetAllProjectsCounterName); var projectManagerContext = new TestProjectManagerContext(); var testController = new PerTestProjectController(); testController.Projects().ForEach(x => { projectManagerContext.Projects.Add(x); }); //Act var controller = new ProjectController(projectManagerContext); dynamic result = controller.GetAllProjects(); getAllProjectsCounter.Increment(); }
public void UpdateProject_ThroughputMode(BenchmarkContext context) { //Arrange updateProjectCounter = context.GetCounter(UpdateProjectCounterName); var projectManagerContext = new TestProjectManagerContext(); var testController = new PerTestProjectController(); testController.Projects().ForEach(x => { projectManagerContext.Projects.Add(x); }); var project = new Project() { ProjectId = 2, Project_Name = "Test Project 2", Priority = 25, Start_Date = new DateTime(2018, 10, 1), End_Date = new DateTime(2018, 10, 2) }; //Act var controller = new ProjectController(projectManagerContext); dynamic result = controller.UpdateProject(project); updateProjectCounter.Increment(); }
public void DeleteProject_ThroughputMode(BenchmarkContext context) { //Arrange deleteProjectCounter = context.GetCounter(DeleteProjectCounterName); var projectManagerContext = new TestProjectManagerContext(); var testController = new PerTestProjectController(); testController.Projects().ForEach(x => { projectManagerContext.Projects.Add(x); }); var project = new Project() { ProjectId = 1 }; //Act var controller = new ProjectController(projectManagerContext); dynamic result = controller.DeleteProject(project.ProjectId); deleteProjectCounter.Increment(); }