Inheritance: SIL.FieldWorks.FDO.Application.SilDataAccessManagedBase
		public void DecoratorDoesNothingWhenTurnedOff()
		{
			var mockDa = new MockDa();
			var underlyingValue = "hello" + zws + "world";
			mockDa.StringValues[new Tuple<int, int>(27, StTxtParaTags.kflidContents)] = m_tsf.MakeString(underlyingValue, 77);
			var decorator = new ShowSpaceDecorator(mockDa);

			var tss = decorator.get_StringProp(27, StTxtParaTags.kflidContents);
			Assert.That(tss.Text, Is.EqualTo(underlyingValue));
			VerifyNoBackColor(tss);
		}
		public void DecoratorReplacesZwsWithGreySpaceWhenTurnedOn()
		{
			var mockDa = new MockDa();
			var underlyingValue = zws + "hello" + zws + "world" + zws + "today";
			mockDa.StringValues[new Tuple<int, int>(27, StTxtParaTags.kflidContents)] = m_tsf.MakeString(underlyingValue, 77);
			var decorator = new ShowSpaceDecorator(mockDa);
			decorator.ShowSpaces = true;

			var tss = decorator.get_StringProp(27, StTxtParaTags.kflidContents);
			Assert.That(tss.Text, Is.EqualTo(" hello world today"));
			VerifyBackColor(tss, new[] { ShowSpaceDecorator.KzwsBackColor, -1, ShowSpaceDecorator.KzwsBackColor, -1, ShowSpaceDecorator.KzwsBackColor, -1 });
		}
		public void DecoratorGetHandlesEmptyStringWhenTurnedOn()
		{
			var mockDa = new MockDa();
			var underlyingValue = "";
			mockDa.StringValues[new Tuple<int, int>(27, StTxtParaTags.kflidContents)] = m_tsf.MakeString(underlyingValue, 77);
			var decorator = new ShowSpaceDecorator(mockDa);
			decorator.ShowSpaces = true;

			var tss = decorator.get_StringProp(27, StTxtParaTags.kflidContents);
			Assert.That(string.IsNullOrEmpty(tss.Text));
			VerifyNoBackColor(tss);
		}
        public void DecoratorDoesNothingWhenTurnedOff()
        {
            var mockDa          = new MockDa();
            var underlyingValue = "hello" + zws + "world";

            mockDa.StringValues[new Tuple <int, int>(27, StTxtParaTags.kflidContents)] = m_tsf.MakeString(underlyingValue, 77);
            var decorator = new ShowSpaceDecorator(mockDa);

            var tss = decorator.get_StringProp(27, StTxtParaTags.kflidContents);

            Assert.That(tss.Text, Is.EqualTo(underlyingValue));
            VerifyNoBackColor(tss);
        }
        public void DecoratorSetHandlesEmptyStringWhenTurnedOn()
        {
            var mockDa          = new MockDa();
            var underlyingValue = "";
            var bldr            = m_tsf.MakeString(underlyingValue, 77).GetBldr();
            var decorator       = new ShowSpaceDecorator(mockDa);

            decorator.ShowSpaces = true;
            decorator.SetString(27, StTxtParaTags.kflidContents, bldr.GetString());
            var tss = mockDa.StringValues[new Tuple <int, int>(27, StTxtParaTags.kflidContents)];

            Assert.That(string.IsNullOrEmpty(tss.Text));
            VerifyNoBackColor(tss);
        }
        public void DecoratorReplacesZwsWithGreySpaceWhenTurnedOn()
        {
            var mockDa          = new MockDa();
            var underlyingValue = zws + "hello" + zws + "world" + zws + "today";

            mockDa.StringValues[new Tuple <int, int>(27, StTxtParaTags.kflidContents)] = m_tsf.MakeString(underlyingValue, 77);
            var decorator = new ShowSpaceDecorator(mockDa);

            decorator.ShowSpaces = true;

            var tss = decorator.get_StringProp(27, StTxtParaTags.kflidContents);

            Assert.That(tss.Text, Is.EqualTo(" hello world today"));
            VerifyBackColor(tss, new[] { ShowSpaceDecorator.KzwsBackColor, -1, ShowSpaceDecorator.KzwsBackColor, -1, ShowSpaceDecorator.KzwsBackColor, -1 });
        }
Example #7
0
        public void DecoratorGetHandlesEmptyStringWhenTurnedOn()
        {
            var mockDa          = new MockDa();
            var underlyingValue = "";

            mockDa.StringValues[new Tuple <int, int>(27, StTxtParaTags.kflidContents)] = TsStringUtils.MakeString(underlyingValue, 77);
            var decorator = new ShowSpaceDecorator(mockDa);

            decorator.ShowSpaces = true;

            var tss = decorator.get_StringProp(27, StTxtParaTags.kflidContents);

            Assert.That(string.IsNullOrEmpty(tss.Text));
            VerifyNoBackColor(tss);
        }
		public void DecoratorReplacesGreySpaceWithZwsWhenTurnedOn()
		{
			var mockDa = new MockDa();
			var underlyingValue = "hello world today keep these spaces";
			var bldr = m_tsf.MakeString(underlyingValue, 77).GetBldr();
			bldr.SetIntPropValues("hello world".Length, "hello world".Length + 1, (int) FwTextPropType.ktptBackColor,
				(int) FwTextPropVar.ktpvDefault, ShowSpaceDecorator.KzwsBackColor);
			bldr.SetIntPropValues("hello".Length, "hello".Length + 1, (int)FwTextPropType.ktptBackColor, (int)FwTextPropVar.ktpvDefault,
					ShowSpaceDecorator.KzwsBackColor);
			var decorator = new ShowSpaceDecorator(mockDa);
			decorator.ShowSpaces = true;
			decorator.SetString(27, StTxtParaTags.kflidContents, bldr.GetString());
			var tss = mockDa.StringValues[new Tuple<int, int>(27, StTxtParaTags.kflidContents)];
			Assert.That(tss.Text, Is.EqualTo("hello" + zws + "world" + zws + "today keep these spaces"));
			VerifyNoBackColor(tss);
		}
        public void DecoratorReplacesGreySpaceWithZwsWhenTurnedOn()
        {
            var mockDa          = new MockDa();
            var underlyingValue = "hello world today keep these spaces";
            var bldr            = m_tsf.MakeString(underlyingValue, 77).GetBldr();

            bldr.SetIntPropValues("hello world".Length, "hello world".Length + 1, (int)FwTextPropType.ktptBackColor,
                                  (int)FwTextPropVar.ktpvDefault, ShowSpaceDecorator.KzwsBackColor);
            bldr.SetIntPropValues("hello".Length, "hello".Length + 1, (int)FwTextPropType.ktptBackColor, (int)FwTextPropVar.ktpvDefault,
                                  ShowSpaceDecorator.KzwsBackColor);
            var decorator = new ShowSpaceDecorator(mockDa);

            decorator.ShowSpaces = true;
            decorator.SetString(27, StTxtParaTags.kflidContents, bldr.GetString());
            var tss = mockDa.StringValues[new Tuple <int, int>(27, StTxtParaTags.kflidContents)];

            Assert.That(tss.Text, Is.EqualTo("hello" + zws + "world" + zws + "today keep these spaces"));
            VerifyNoBackColor(tss);
        }