示例#1
0
        public void ISenseOrEntryHeadwordRef_IncludesSenseNumber()
        {
            var mainEntry = CreateInterestingLexEntry(Cache, "MainEntry", "MainSense");

            AddSenseToEntry(mainEntry, "SecondSense", EnsureWritingSystemSetup(Cache, "en", false), Cache);
            var secondSense = new SenseOrEntry(mainEntry.SensesOS[1]);

            CreateInterestingLexEntry(Cache, "MainEntry", "Nonsense");             // create a homograph

            // SUT
            Assert.AreEqual("MainEntry1 2", secondSense.HeadWordRef.BestVernacularAlternative.Text);
        }
示例#2
0
        public void ISenseOrEntryHeadwordRef_IncludesSenseNumber()
        {
            var mainEntry = CreateInterestingLexEntry(Cache, "MainEntry", "MainSense");

            AddSenseToEntry(mainEntry, "SecondSense", EnsureWritingSystemSetup(Cache, "en", false), Cache);
            var secondSense = new SenseOrEntry(mainEntry.SensesOS[1]);

            CreateInterestingLexEntry(Cache, "MainEntry", "Nonsense");             // create a homograph

            // Set default sense number style
            var settings = Cache.ServiceLocator.GetInstance <HomographConfiguration>();

            settings.ksSenseNumberStyle = "%d";

            // SUT
            Assert.AreEqual("MainEntry1 2", secondSense.HeadWordRef.BestVernacularAlternative.Text);
        }
示例#3
0
        public void ISenseOrEntryHeadwordRef_SenseNumberNotShownWhenHCSenseIsNotShown()
        {
            var mainEntry = CreateInterestingLexEntry(Cache, "MainEntry", "MainSense");

            AddSenseToEntry(mainEntry, "SecondSense", EnsureWritingSystemSetup(Cache, "en", false), Cache);
            var secondSense     = new SenseOrEntry(mainEntry.SensesOS[1]);
            var referencedEntry = CreateInterestingLexEntry(Cache);

            CreateLexicalReference(mainEntry, referencedEntry, "");
            CreateInterestingLexEntry(Cache, "MainEntry", "Nonsense");

            // Set empty sense number style
            var settings = Cache.ServiceLocator.GetInstance <HomographConfiguration>();

            settings.ksSenseNumberStyle = "";

            // SUT
            Assert.AreEqual("MainEntry1", secondSense.HeadWordRef.BestVernacularAlternative.Text);
        }