public async Task ReturnExtendedAnswerByIdWhenHasData() { // Arrange int expectedId = 1; var answers = new Faker <AnswersBaseModel>() .RuleFor(s => s.Id, v => ++ v.IndexVariable) .RuleFor(s => s.UserId, v => v.IndexVariable) .RuleFor(s => s.OptionId, v => v.IndexVariable); var options = new Faker <OptionBaseModel>() .RuleFor(s => s.Id, v => ++ v.IndexVariable); var question = new Faker <QuestionModelBase>() .RuleFor(s => s.Id, v => ++ v.IndexVariable); // Act var result = await _controller.GetById(expectedId); // Assert result.Should().BeOfType <OkObjectResult>(); var model = result as OkObjectResult; model?.Value.Should().BeOfType <SurveyUserExtended>().Subject.Id.Should().Be(expectedId); }