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); }
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); }
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(); }
public QuestionsController(IJeopardyRepository repository, IMapper mapper) { _repository = repository; _mapper = mapper; }
public CategoriesController(IJeopardyRepository repository, IMapper mapper) { _repository = repository; _mapper = mapper; }