Beispiel #1
0
		public void PreserveCase()
		{
			Assert.AreEqual(6, m_axxOccurrences.Count);
			int ich2ndOcc = Cache.GetIntProperty(m_para1Occurrences[1], kflidBeginOffset);
			RespellUndoAction action = new RespellUndoAction(Cache, "axx", "ayyy");
			action.AddOccurrence(m_para1Occurrences[0]);
			action.AddOccurrence(m_para1Occurrences[1]);
			action.SetupPreviews(tagPrecedingContext, tagPreview, tagAdjustedBegin, tagAdjustedEnd, tagEnabled, m_axxOccurrences);
			Assert.AreEqual("Axx", Cache.GetTsStringProperty(m_para1Occurrences[0], tagPrecedingContext).Text,
				"Old value at start without preserve case");
			Assert.AreEqual("ayyy simplexx testxx withxx axx", Cache.GetTsStringProperty(m_para1Occurrences[1], tagPrecedingContext).Text,
				"Preceding context without preserve case has LC");
			action.PreserveCase = true;
			action.UpdatePreviews();
			Assert.AreEqual("Axx", Cache.GetTsStringProperty(m_para1Occurrences[0], tagPrecedingContext).Text,
				"Old value at start with preserver case");
			Assert.AreEqual("Ayyy simplexx testxx withxx axx", Cache.GetTsStringProperty(m_para1Occurrences[1], tagPrecedingContext).Text,
				"Preceding context with preserve case has UC");
		}