Esempio n. 1
0
        public void PutRegistrated_WhenCalled_ReturnsNotFound(int id)
        {
            // Arrange
            service.Setup(x => x.Update(userService))
            .Returns(true);

            mapper.Setup(x => x.Map <WorkerServiceModel>(It.IsAny <WorkerControllerModel>()))
            .Returns(userService);

            // Act
            var result = usersController.PutWorker(id, userController);

            // Assert
            var response = result as StatusCodeResult;

            Assert.Equal(400, response.StatusCode);
        }
Esempio n. 2
0
        public void PutRegistrated_WhenCalled__ReturnsInternalError(int id)
        {
            // Arrange
            usersController = new WorkersController(null, null, log.Object);

            // Act
            var result = usersController.PutWorker(id, userController);

            // Assert
            var response = result as StatusCodeResult;

            Assert.Equal(500, response.StatusCode);
        }