public async Task getAllExamsForACourse_ShouldReturnListOfExamDto() { var course = new Course(_exam.Course.Name, _exam.Course.Year, new List <Domain.Entities.Exam> { _exam }); var courses = new List <Course> { course }; var exams = new List <ExamDto> { _examDto }; var mockExamsQueryable = courses.AsQueryable().BuildMock(); _mockReadRepository.Setup(repo => repo.GetAll <Domain.Entities.Course>()).Returns(mockExamsQueryable); _mockExamMapper.Setup(mapper => mapper.Map(_exam)).Returns(_examDto); var actualExamsDtoList = await _examService.GetAllExamsForACourse(course.Id); // Assert actualExamsDtoList.Should().BeEquivalentTo(exams); }