//There is an assumption that the answers on the question instance are already sorted for display to the user when NextQuestion was called. public static QuizQuestionDto ToDto(this Question entity, IQuizManager quizManager) => new QuizQuestionDto { Id = entity.Id, Description = entity.Description, AllowMultipleAnswers = entity.AllowMultipleAnswers, Answers = entity.Answers.Select((a, index) => a.ToDto(index, quizManager)), };
public AnswerControllerTests() { _dataAccessMock = new Mock <IQuizDataAccess <DataEntity.Answer> >(); _topicRepositoryMock = new Mock <ITopicRepository>(); _questionRepositoryMock = new Mock <IQuestionRepository>(); _answerRepository = new Mock <IAnswerRepository>(); _quizManager = new QuizManager.QuizManager( _topicRepositoryMock.Object, _questionRepositoryMock.Object, _answerRepository.Object); _answerController = new AnswerController(_quizManager); }
public TopicControllerTests() { _dataAccessMock = new Mock <IQuizDataAccess <DataEntity.Topic> >(); _topicCacheMock = new Mock <IQuizCache <DataEntity.Topic> >(); _topicRepository = new Mock <ITopicRepository>(); _quizRepository = new Mock <IQuestionRepository>(); _answerRepository = new Mock <IAnswerRepository>(); _loggerMock = new Mock <ILogger <TopicController.TopicController> >(); _quizManager = new QuizManager.QuizManager( _topicRepository.Object, _quizRepository.Object, _answerRepository.Object); _topicControllerMock = new TopicController.TopicController( _quizManager, _loggerMock.Object); }
public QuestionControllerTests() { _questionDataAccessMock = new Mock <IQuizDataAccess <DataEntity.Question> >(); _questionsCacheMock = new Mock <IQuizCache <DataEntity.Question> >(); _topicCacheMock = new Mock <IQuizCache <DataEntity.Topic> >(); _topicRepositoryMock = new Mock <ITopicRepository>(); _questionRepositoryMock = new Mock <IQuestionRepository>(); _answerRepository = new Mock <IAnswerRepository>(); _quizManager = new QuizManager.QuizManager( _topicRepositoryMock.Object, _questionRepositoryMock.Object, _answerRepository.Object); _questionController = new QuestionController(_quizManager); _redisServerMock = new Mock <IDistributedCache>(); }
public TopicController(IQuizManager quizManager, ILogger <TopicController> logger) { _quizManager = quizManager; _loggerTopic = logger; }
/// <summary> /// /// </summary> /// <param name="quizManager"></param> public QuizzesController(IQuizManager quizManager) { this.quizManager = quizManager; }
public QuizController(IQuizManager quizManager) { _quizManager = quizManager; }
public QuizRunner(IQuizManager quizManager) { this.quizManager = quizManager; }
public QuizViewModel(IQuizManager quizManager) { _quizManager = quizManager; }
public QuizService(DatabaseContext context, IQuizManager quizManager) { _context = context; _quizManager = quizManager; }
public QuestionController( IQuizManager quizManager, ILogger <QuestionController> log) { _quizManager = quizManager; _log = log; }
public QuizRunner(IQuizManager quizManager) { this.quizManager = quizManager; }
public AnswerController(IQuizManager quizManager) { _quizManager = quizManager; }
public static QuizAnswerDto ToDto(this Answer entity, int index, IQuizManager quizManager) => new QuizAnswerDto { Id = entity.Id, Name = quizManager.InterpolateAnswerName(entity, index), Description = entity.Description };