Ejemplo n.º 1
0
 public TestService(
     IDataRepository <Test> testRepo, IDataRepository <Question> questionRepo, IDataRepository <Answer> answerRepo, IDataSaver dataSaver,
     IMappingProvider mapper, IDataRepository <Category> categoryRepo,
     IRandomProvider random, IShuffleProvider shuffler, IMemoryCache memoryCache)
 {
     this.testRepo     = testRepo ?? throw new ArgumentNullException(nameof(testRepo));
     this.questionRepo = questionRepo ?? throw new ArgumentNullException(nameof(questionRepo));
     this.answerRepo   = answerRepo ?? throw new ArgumentNullException(nameof(answerRepo));
     this.dataSaver    = dataSaver ?? throw new ArgumentNullException(nameof(dataSaver));
     this.mapper       = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.categoryRepo = categoryRepo ?? throw new ArgumentNullException(nameof(categoryRepo));
     this.random       = random;
     this.shuffler     = shuffler ?? throw new ArgumentNullException(nameof(shuffler));
     this.memoryCache  = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Specify the ShuffleProvider for shuffling this deck of cards
 /// </summary>
 /// <param name="shuffleProvider"></param>
 public void SetShuffleProvider(IShuffleProvider shuffleProvider)
 {
     this.shuffler = shuffleProvider;
 }
Ejemplo n.º 3
0
 public Deck(IShuffleProvider shuffleProvider)
 {
     this.SetShuffleProvider(shuffleProvider);
     this.Reset();
 }