public void GetExamById_ShouldThrowExamNotFoundException() { // Arrange Guid mockGuid = new Guid(); _mockReadRepository.Setup(repo => repo.GetByIdAsync <Domain.Entities.Exam>(mockGuid)).Throws(new ExamNotFoundException(mockGuid)); // Act Func <Task> act = async() => await _examService.GetById(mockGuid); // Assert act.Should().Throw <ExamNotFoundException>(); }