public async Task GetEnrollmentsByFilter_WhenFilterIsNull_ShouldReturnBadRequest() { //Arrange var controller = new EnrollmentController(_enrollmentProcessorMock.Object); //Act var response = await controller.GetEnrollmentsByFilter(null); //Assert Assert.IsType <BadRequestResult>(response); }
public async Task GetEnrollmentsByFilter_WhenPassValidFilters_ShouldReturnFilteredEnrollments() { //Arrange var filter = new ReportFilter(); _enrollmentProcessorMock.Setup(p => p.GetEnrollmentsByFilter(null, filter)).ReturnsAsync(_enrollments); var controller = new EnrollmentController(_enrollmentProcessorMock.Object); //Act var response = await controller.GetEnrollmentsByFilter(filter); //Assert var okResult = Assert.IsType <OkObjectResult>(response); var returnValue = Assert.IsType <List <Enrollment> >(okResult.Value); Assert.NotEmpty(returnValue); }