Exemplo n.º 1
0
        public void GetAllEntriesSortedByHeadWord_ModifyAndSaveMultipleAfterFirstCall_EntriesModifiedAndSortedInResultSet()
        {
            List <LexEntry> entriesToModify = new List <LexEntry>();

            entriesToModify.Add(CreateEntryWithLexicalFormBeforeFirstQuery("de", "word 0"));
            entriesToModify.Add(CreateEntryWithLexicalFormBeforeFirstQuery("de", "word 1"));

            _repository.GetAllEntriesSortedByHeadword(WritingSystemDefinition.Parse("de"));

            entriesToModify[0].LexicalForm["de"] = "word 3";
            entriesToModify[1].LexicalForm["de"] = "word 2";
            _repository.SaveItems(entriesToModify);

            ResultSet <LexEntry> results = _repository.GetAllEntriesSortedByHeadword(WritingSystemDefinition.Parse("de"));

            Assert.AreEqual(2, results.Count);
            Assert.AreEqual("word 2", results[0]["Form"]);
            Assert.AreEqual("word 3", results[1]["Form"]);
        }