private int AddToDictionary(string documentSource) { _documentReader.Load(documentSource); int wordsCounter = 0; string word = _documentReader.ReadNextWord(); while (!string.IsNullOrWhiteSpace(word)) { if (_filters.Any(filter => filter.Skip(word))) { word = _documentReader.ReadNextWord(); continue; } foreach (IWordFormatter formatter in _formatters) { word = formatter.ApplyFormat(word); } _documentDictionary.Put(word); wordsCounter++; word = _documentReader.ReadNextWord(); } return(wordsCounter); }
public void load_by_key_does_not_exist() { _reader.Load(Guid.NewGuid()); }