public async Task Should_return_not_found_if_no_test_score_is_not_found() { var participantId = Guid.NewGuid(); _pollyRetryService .Setup(x => x.WaitAndRetryAsync <NotFoundException, TestCallResult> ( It.IsAny <int>(), It.IsAny <Func <int, TimeSpan> >(), null, It.IsAny <Func <Task <TestCallResult> > >()) ) .ThrowsAsync(new NotFoundException("any")); var result = await _controller.GetTestCallResultForParticipant(participantId); Assert.NotNull(result); Assert.IsAssignableFrom <NotFoundObjectResult>(result); var objectResult = (ObjectResult)result; objectResult.Value.Should().Be($"No test score result found for participant Id: {participantId}"); }