public TestQuestionsController()
        {
            var mappingConfig = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new JeopardyMappingProfile());
            });

            model = new QuestionsModel()
            {
                Id = 55, QuestionEn = "TestQuestion 1", QuestionFr = "TestQuestion 1 en francais", AnswerEn = "TestAnswer 1", AnswerFr = "TestAnswer 1 en francais", CategoryId = 30, Hint = "Test Hint 1", Points = 100, TimeLimit = 30
            };

            updateModel = new QuestionsModel()
            {
                Id = 32, QuestionEn = "TestQuestion 112434", QuestionFr = "TestQuestion 112434 en francais", AnswerEn = "TestAnswer 1", AnswerFr = "TestAnswer 1 en francais", CategoryId = 30, Hint = "Test Hint 1", Points = 100, TimeLimit = 30
            };

            var mapper = mappingConfig.CreateMapper(); // Use this mapper to instantiate your class

            _mapper = mapper;

            _service = new JeopardyRepositoryFake(testContext);

            _controller = new QuestionsController(_service, _mapper);
        }
Exemple #2
0
        public TestCategoriesController()
        {
            var mappingConfig = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new JeopardyMappingProfile());
            });

            model = new CategoriesModel()
            {
                Id = 35, CategoryNameEn = "FiveCATS", CategoryNameFr = "TestCat 5 en francais"
            };

            updateModel = new CategoriesModel()
            {
                Id = 34, CategoryNameEn = "FiveCATEGORIES", CategoryNameFr = "TestCat 5 en francaisss"
            };

            var mapper = mappingConfig.CreateMapper(); // Use this mapper to instantiate your class

            _mapper = mapper;

            _service = new JeopardyRepositoryFake(testContext);

            _controller = new CategoriesController(_service, _mapper);
        }
Exemple #3
0
 public QuestionsController(IJeopardyRepository repo, IOptions <NSJDocumentDbSettings> settings)
 {
     _repo             = repo;
     repo.EndpointUri  = settings.Value.EndpointUri;
     repo.PrimaryKey   = settings.Value.PrimaryKey;
     repo.DatabaseName = settings.Value.DatabaseName;
     repo.Collection   = settings.Value.Collection;
     repo.CreateDocumentClient().Wait();
 }
Exemple #4
0
 public QuestionsController(IJeopardyRepository repository, IMapper mapper)
 {
     _repository = repository;
     _mapper     = mapper;
 }
Exemple #5
0
 public CategoriesController(IJeopardyRepository repository, IMapper mapper)
 {
     _repository = repository;
     _mapper     = mapper;
 }