コード例 #1
0
        public void GetUserById_ThroughputMode(BenchmarkContext context)
        {
            //Arrange
            getUserByIdCounter = context.GetCounter(GetUserByIdCounterName);
            var projectManagerContext = new TestProjectManagerContext();
            var testController        = new PerTestUserController();

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


            //Act
            var     controller = new UserController(projectManagerContext);
            dynamic result     = controller.GetUserById(1);

            getUserByIdCounter.Increment();
        }
コード例 #2
0
        public void Updateuser_ThroughputMode(BenchmarkContext context)
        {
            //Arrange
            updateUserCounter = context.GetCounter(UpdateUserCounterName);
            var projectManagerContext = new TestProjectManagerContext();
            var testController        = new PerTestUserController();

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

            var user = new User()
            {
                UserId = 1, First_Name = "Mathan", Last_Name = "Test Last Name 1", Employee_Id = "12"
            };

            //Act
            var     controller = new UserController(projectManagerContext);
            dynamic result     = controller.UpdateUser(user);

            updateUserCounter.Increment();
        }
コード例 #3
0
        public void DeleteUser_ThroughputMode(BenchmarkContext context)
        {
            //Arrange
            deleteUserCounter = context.GetCounter(DeleteUserCounterName);
            var projectManagerContext = new TestProjectManagerContext();
            var testController        = new PerTestUserController();

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

            var user = new User()
            {
                UserId = 1
            };

            //Act
            var     controller = new UserController(projectManagerContext);
            dynamic result     = controller.DeleteUser(user.UserId);

            deleteUserCounter.Increment();
        }