private async Task <List <string> > FindUniqueWordsAsync(IWordsRepository wordsRepository, List <string> words) { var skip = 0; var take = 100; var n = words.Count; var uniqueWords = new List <string>(); while (skip < n) { var wordsPart = words .Skip(skip) .Take(take) .ToList(); var foundWords = await wordsRepository.FindAsync(wordsPart); var uniqueWordsPart = wordsPart .Except(foundWords.Select(wi => wi.Word)); uniqueWords.AddRange(uniqueWordsPart); skip += take; } return(uniqueWords); }
public ContentProcessorLauncher(IContentProcessor contentProcessor, IWordsRepository wordsRepository, ITextFileReader textFileReader, IInputOutput inputOutput) { _contentProcessor = contentProcessor; _wordsRepository = wordsRepository; _textFileReader = textFileReader; _inputOutput = inputOutput; }
public void Setup() { _wordsRepository = Substitute.For <IWordsRepository>(); _appConfig = Substitute.For <IAppConfig>(); _wordsService = new WordsService(_wordsRepository, _appConfig); }
public AnagramsService(IWordsRepository wordsRepository, ICacheRepository cacheRepository, IUsersRepository usersRepository, IAnagramSolver anagramSolver) { _wordsRepository = wordsRepository; _cacheRepository = cacheRepository; _usersRepository = usersRepository; _anagramSolver = anagramSolver; }
public void Setup() { _wordsRepository = Substitute.For <IWordsRepository>(); _usersRepository = Substitute.For <IUsersRepository>(); _dummyWordsRepository = new DummyWordsRepository(); _dictionaryService = new DictionaryService(_wordsRepository, _usersRepository); }
public void SetUp() { wordsRepository = new DummyWordsRepository(); config = Options.Create <AnagramConfiguration>(new AnagramConfiguration() { minWordLength = 3, maxResultsLength = 15 }); }
public HttpServer(string url, IWordsRepository repository) { _wordDictionary = new WordDictionary(repository); listener = new HttpListener(); listener.Prefixes.Add(url); Console.WriteLine($"Listening for connections on {url}"); }
public GenerateNewGameAction(AddWordsToGridLeftToRightService addWordsService, FillGridService fillGridService, IShuffleWordsService shuffleWordsService, IGameService gameService, IWordsRepository words) { this.addWordsService = addWordsService; this.fillGridService = fillGridService; this.shuffleWordsService = shuffleWordsService; this.gameService = gameService; this.words = words; }
static RepositoryFactory() { UsersRepository = new EFUsersRepository(); QuestionsRepository = new EFQuestionsRepository(); LanguageRepository = new EFLanguageRepository(); WordsRepository = new EfWordsRepository(); CategoryRepository = new EfCategoriesRepository(); GrammarRepository = new EfGrammarRepository(); }
public void Setup() { wordsRepository = new InMemoryWordsRepository(); ramdomPositionGenerator = new SomeRandomQueuedPositionGenerator(); shuffleWordsService = new SomeShuffleWordsService(); addWordsService = new AddWordsToGridLeftToRightService(ramdomPositionGenerator); }
public WordsService( IWordsRepository wordsRepository, ISessionRepository sessionRepository, ICacheService cacheService) { _wordRepository = wordsRepository; _sessionRepository = sessionRepository; _cacheService = cacheService; }
public ExerciseFactory( IUserRepository userRepository, IWordsRepository wordsRepository, TranslationTrainerSettings settings) { _userRepository = userRepository ?? throw new ArgumentNullException(nameof(userRepository)); _wordsRepository = wordsRepository ?? throw new ArgumentNullException(nameof(wordsRepository)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); }
public DictionaryController( IOptions <Dictionary> dictionaryConfiguration, IWordsRepository wordsRepository, IDictionaryService dictionaryService) { _dictionaryConfiguration = dictionaryConfiguration.Value; _dictionaryService = dictionaryService; _wordsRepository = wordsRepository; }
public DefaultController( IWordsRepository <Word, WordsCountBotDbContext> wordsRepo, IChatsRepository <Chat, WordsCountBotDbContext> chatsRepo, IUsagesRepository <WordUsedTimes, WordsCountBotDbContext> usagesRepo ) { _wordsRepo = wordsRepo; _chatsRepo = chatsRepo; _usagesRepo = usagesRepo; }
public async Task <List <string> > AddUniqueWordsAsync(IWordsRepository wordsRepository, List <string> words) { var result = await wordsRepository.TryAddNewWordsAsync(words); var uniqueWords = result .Select(x => words[x.RowId - 1]) .ToList(); return(uniqueWords); }
public void Setup() { _anagramSolver = Substitute.For <IAnagramSolver>(); _wordsRepository = Substitute.For <IWordsRepository>(); _cacheRepository = Substitute.For <ICacheRepository>(); _usersRepository = Substitute.For <IUsersRepository>(); _dummyWordsRepository = new DummyWordsRepository(); _anagramsService = new AnagramsService(_wordsRepository, _cacheRepository, _usersRepository, _anagramSolver); }
public ExerciseFinisher( IWordsRepository wordsRepository, IUserRepository userRepository, IExerciseRepository exerciseRepository, TranslationTrainerSettings settings) { _wordsRepository = wordsRepository ?? throw new ArgumentNullException(nameof(wordsRepository)); _userRepository = userRepository ?? throw new ArgumentNullException(nameof(userRepository)); _exerciseRepository = exerciseRepository ?? throw new ArgumentNullException(nameof(exerciseRepository)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); }
public async Task <List <string> > AddUniqueWordsAsync(IWordsRepository wordsRepository, List <string> words) { var uniqueWords = await FindUniqueWordsAsync(wordsRepository, words); if (uniqueWords.Any()) { _workQueuePublisher.Publish(new WordsWorkQueueItem(uniqueWords)); } return(uniqueWords); }
public WriteFasterPathToFileHandler(IWordsRepository wordsRepository, ISearchShortestPath <Word> searchWordsPath, IDocumentListWriter <Word> documentListWriter, ITreeNodeBuilder <Word> treeNodeBuilder, ILogger <WriteFasterPathToFileHandler> logger) { _wordsRepository = wordsRepository; _searchWordsPath = searchWordsPath; _documentListWriter = documentListWriter; _treeNodeBuilder = treeNodeBuilder; _logger = logger; }
public RandomWordGenerator(IWordsRepository wordRepository) { WordRepository = wordRepository; Puzzle = new Puzzle { Id = -1, Name = StaticName, Description = StaticDescription, PuzzleWords = new List <PuzzleWord>(), Kind = this }; }
public ServerManager(IUsersRepository usersRepository, IFriendsRepository friendsRepository, IMessagesRepository messagesRepository, IWordsRepository wordsRepository) { this.usersRepository = usersRepository; this.friendsRepository = friendsRepository; this.messagesRepository = messagesRepository; this.wordsRepository = wordsRepository; LoggedUsers = new ConcurrentDictionary <int, User>(); ActiveRooms = new ConcurrentDictionary <int, Room>(); ActiveGames = new ConcurrentDictionary <int, Game>(); }
public WcbTelegramBot( ILogger <WcbTelegramBot> logger, IWordsRepository <Word, WordsCountBotDbContext> wordsRepo, IChatsRepository <MyChat, WordsCountBotDbContext> chatsRepo, IUsagesRepository <WordUsedTimes, WordsCountBotDbContext> usagesRepo, IWcbTelegramClient client ) { _logger = logger; _wordsRepo = wordsRepo; _chatsRepo = chatsRepo; _usagesRepo = usagesRepo; _client = client; }
public void Setup() { _dictionaryConfiguration = Substitute.For <IOptions <Dictionary> >(); _dictionaryConfiguration.Value.Returns(new Dictionary() { pageSize = 100, path = " " }); _wordsRepository = Substitute.For <IWordsRepository>(); _dictionaryService = Substitute.For <IDictionaryService>(); _fileRepository = Substitute.For <IFileRepository>(); _dictionaryController = new DictionaryController(_dictionaryConfiguration, _wordsRepository, _dictionaryService); }
private async Task AddNewWordsAsync(IWordsRepository wordsRepository, List <string> words) { var skip = 0; var take = 100; var n = words.Count; while (skip < n) { var wordsPart = words .Skip(skip) .Take(take) .ToList(); await wordsRepository.TryAddNewWordsWithNoSyncAsync(wordsPart); skip += take; } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure( IApplicationBuilder app, IHostingEnvironment env, IWordsRepository words) { app.UseStaticFiles(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error/View"); } app.Run(async(context) => { var thirdWord = words.Find(2); await context.Response.WriteAsync(thirdWord.Text); }); }
public Training(IWordsRepository wordsRepository) { _wordsRepository = wordsRepository; }
public WordsApplication(IWordsRepository repository) { _wordsRepository = (repository != null) ? repository : throw new ArgumentNullException("Unable to instantiate WordsRepository becuase the provided WordsRepository is null."); }
public WordsProvider(IWordsRepository repository) { _repository = repository; }
public DutchWordsService(IWordsRepository _textFileWordsRepository) { textFileRepository = _textFileWordsRepository; }
public Challenge(IWordsRepository wordsRepository) { _wordsRepository = wordsRepository; }
public WordDictionary(IWordsRepository repository) =>
public ProfileSearchWordsProvider(CachedItemProvider<IList<string>> cachedWords, IWordsRepository repository) { _cachedItemProvider = cachedWords; _repository = repository; }