public void OneSenseExampleCustomFieldWritingSystemWithOneWithoutAnalysis() { LexEntry entry = CreateEmptyLexEntryWithOneEmptySentence(); LexExampleSentence example = entry.Senses[0].ExampleSentences[0]; MultiText custom = example.GetOrCreateProperty<MultiText>("customField"); custom["vernacular"] = "filler"; LexSense sense = new LexSense(); entry.Senses.Add(sense); example = new LexExampleSentence(); sense.ExampleSentences.Add(example); custom = example.GetOrCreateProperty<MultiText>("customField"); custom["analysis"] = "filler"; Assert.AreEqual(true, _missingCustomFieldFilter.FilteringPredicate(entry)); }
public void RemoveWord_HasCustomFieldInExample_DisassociatesWordFromDomain() { LexEntry e = _lexEntryRepository.CreateItem(); e.LexicalForm.SetAlternative("br", "peixe"); LexSense s = AddNewSenseToEntry(e); OptionRefCollection o = s.GetOrCreateProperty<OptionRefCollection>( LexSense.WellKnownProperties.SemanticDomainsDdp4); o.Add(Task.DomainKeys[0]); LexExampleSentence example = new LexExampleSentence(); s.ExampleSentences.Add(example); OptionRef optionRef = example.GetOrCreateProperty<OptionRef>("custom"); optionRef.Value = "hello"; _lexEntryRepository.SaveItem(e); int originalCount = _lexEntryRepository.CountAllItems(); Task.CurrentDomainIndex = 0; Task.DetachFromMatchingEntries("peixe"); Assert.AreEqual(originalCount, _lexEntryRepository.CountAllItems()); }