public void TestMatches() { var databasePath = _currentPath + "/Files/Dictionary.db"; var connectionString = $"Data Source = {databasePath}; Version = 3;"; var repository = new WordRepository(connectionString); var matches = repository.GetMatches("DONE"); Assert.IsNotNull(matches); Assert.IsTrue(matches.Count() > 0); }
public IEnumerable <WordViewModel> GetMatchesFromDb(string partial) { if (string.IsNullOrEmpty(partial)) { return(null); } var entities = _repository.GetMatches(partial); var output = new List <WordViewModel>(); foreach (var entity in entities) { output.Add(WordConverter.ConvertFromEntity(entity)); } return(output); }