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)); }
/// <summary> /// Specify the ShuffleProvider for shuffling this deck of cards /// </summary> /// <param name="shuffleProvider"></param> public void SetShuffleProvider(IShuffleProvider shuffleProvider) { this.shuffler = shuffleProvider; }
public Deck(IShuffleProvider shuffleProvider) { this.SetShuffleProvider(shuffleProvider); this.Reset(); }