Ejemplo n.º 1
0
        public async Task GetEnrollmentsByFilterId_WhenFilterIdIsZero_ShouldReturnBadRequest()
        {
            //Arrange
            var controller = new EnrollmentController(_enrollmentProcessorMock.Object);

            //Act
            var response = await controller.GetEnrollmentsByFilterId(0);

            //Assert
            Assert.IsType <BadRequestResult>(response);
        }
Ejemplo n.º 2
0
        public async Task GetEnrollmentsByFilterId_WhenFilterIdIsValid_ShouldReturnEnrollmentsByFilterId()
        {
            //Arrange
            _enrollmentProcessorMock.Setup(p => p.GetEnrollmentsByFilterId(1)).ReturnsAsync(_enrollments);
            var controller = new EnrollmentController(_enrollmentProcessorMock.Object);

            //Act
            var response = await controller.GetEnrollmentsByFilterId(1);

            //Assert
            var okResult    = Assert.IsType <OkObjectResult>(response);
            var returnValue = Assert.IsType <List <Enrollment> >(okResult.Value);

            Assert.NotEmpty(returnValue);
        }