Inheritance: SIL.FieldWorks.FDO.Application.DomainDataByFlidDecoratorBase
Esempio n. 1
0
        public void SenseOutlineIsObtainedUsingVirtual()
        {
            // For this test we need a real entry and sense.
            var entry = Cache.ServiceLocator.GetInstance <ILexEntryFactory>().Create();
            var sense = Cache.ServiceLocator.GetInstance <ILexSenseFactory>().Create();

            entry.SensesOS.Add(sense);
            var sda = new MockDecorator(Cache);
            var vc  = new XmlVc("root", true, null, null, sda);

            vc.SetCache(Cache);
            var sut = new XmlVcDisplayVec(vc, new MockEnv(), entry.Hvo, LexEntryTags.kflidSenses, 1);

            Assert.That(sut.CalculateAndFormatSenseLabel(sense.Hvo, 0, "%O)"), Is.EqualTo("77)"),
                        "CalculateAndFormatSenseLabel should have used the decorator method");
            Assert.That(sda.Tag, Is.EqualTo(Cache.MetaDataCacheAccessor.GetFieldId2(LexSenseTags.kClassId, "LexSenseOutline", false)),
                        "CalculateAndFormatSenseLabel should have used the right property");
        }
Esempio n. 2
0
		public void SenseOutlineIsObtainedUsingVirtual()
		{
			// For this test we need a real entry and sense.
			var entry = Cache.ServiceLocator.GetInstance<ILexEntryFactory>().Create();
			var sense = Cache.ServiceLocator.GetInstance<ILexSenseFactory>().Create();
			entry.SensesOS.Add(sense);
			var sda = new MockDecorator(Cache);
			var vc = new XmlVc(null, "root", true, null, null, sda);
			vc.SetCache(Cache);
			var sut = new XmlVcDisplayVec(vc, new MockEnv(), entry.Hvo, LexEntryTags.kflidSenses, 1);

			Assert.That(sut.CalculateAndFormatSenseLabel(sense.Hvo, 0, "%O)"), Is.EqualTo("77)"),
				"CalculateAndFormatSenseLabel should have used the decorator method");
			Assert.That(sda.Tag, Is.EqualTo(Cache.MetaDataCacheAccessor.GetFieldId2(LexSenseTags.kClassId, "LexSenseOutline", false)),
				"CalculateAndFormatSenseLabel should have used the right property");
		}