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); }
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); }