public void TestGetMany() { //string name1 = _uniqueNames.Pop(); string name1; _uniqueNames.TryPop(out name1); //string name2 = _uniqueNames.Pop(); string name2; _uniqueNames.TryPop(out name2); IEnumerable <ITextModel> modelsFromDb = _textStore.GetMany(x => x.Name == name1); List <ITextModel> models = modelsFromDb.ToList(); Assert.AreEqual(0, models.Count); StreamReader text1 = new StreamReader("../../SampleTextFiles/WordSpanningMultipleLines.txt"); StreamReader text2 = new StreamReader("../../SampleTextFiles/MismatchedQuotationMarks.txt"); ITextModel model1 = _modelFactory.GetTextModel(name1, text1, UniversalConstants.CountSize); ITextModel model2 = _modelFactory.GetTextModel(name2, text2, UniversalConstants.CountSize); _textStore.Add(model1); _textStore.Add(model2); modelsFromDb = _textStore.GetMany(x => x.Name == name1 || x.Name == name2); models = modelsFromDb.ToList(); CompareTextModels(model1, models[0]); CompareTextModels(model2, models[1]); _textStore.Delete(model1); _textStore.Delete(model2); }
public List <ITextViewModel> GetAllTexts() { return(_textStore.GetMany(x => true).Select(x => (ITextViewModel)x).ToList()); }