private static async Task SeedDBWithFileData() { var fileRepo = new FileRepository(); var connection = new WordRepositoryDB(); var wordsList = await fileRepo.GetAllWords(); foreach (var word in wordsList) { var model = new Anagram() { Category = word.Category, Word = word.Word, }; await connection.AddNewWord(model); } }
public async Task InsertNewWordSuccess() { var word = new Anagram() { Category = "dkt", Word = "alus" }; await _repo.AddNewWord(word); var insertedWord = await GetWordByPhrase(word.Word); Assert.AreEqual(word.Category, insertedWord.Category); Assert.AreEqual(word.Word, insertedWord.Word); Assert.AreEqual(String.Concat(word.Word.OrderBy(x => x)), insertedWord.SortedWord); }