Ejemplo n.º 1
0
        private void MethodDeleteExerciseDeletesVideoFromRepo()
        {
            //Setup repo mock
            _exerciseServiceMock.Setup(service => service.GetById(3)).Returns(_exerciseDTO1);
            _exerciseServiceMock.Setup(service => service.Delete(1));

            //Check if correct response is returned
            var actionResult = _controller.DeleteExercise(1);

            Assert.IsType <OkResult>(actionResult);

            //Check if Delete method is called in controller
            _exerciseServiceMock.Verify(service => service.Delete(1), Times.Once);
        }