Inheritance: IScrCheckInventory
		void Test(string[] result, string text, string desiredKey)
		{
			m_source.Text = text;

			MixedCapitalizationCheck check = new MixedCapitalizationCheck(m_source);
			List<TextTokenSubstring> tts =
				check.GetReferences(m_source.TextTokens(), desiredKey);

			Assert.AreEqual(result.GetUpperBound(0)+1, tts.Count,
				"A different number of results was returned than what was expected." );

			for (int i = 0; i <= result.GetUpperBound(0); ++i)
				Assert.AreEqual(result[i], tts[i].InventoryText, "Result number: " + i.ToString());
		}
Exemplo n.º 2
0
        void Test(string[] result, string text, string desiredKey)
        {
            m_source.Text = text;

            MixedCapitalizationCheck  check = new MixedCapitalizationCheck(m_source);
            List <TextTokenSubstring> tts   =
                check.GetReferences(m_source.TextTokens(), desiredKey);

            Assert.AreEqual(result.GetUpperBound(0) + 1, tts.Count,
                            "A different number of results was returned than what was expected.");

            for (int i = 0; i <= result.GetUpperBound(0); ++i)
            {
                Assert.AreEqual(result[i], tts[i].InventoryText, "Result number: " + i.ToString());
            }
        }
Exemplo n.º 3
0
        public void ChangeCharacterCategorizerAfterInstantiationOfCheck()
        {
            MixedCapitalizationCheck check = new MixedCapitalizationCheck(m_source);

            m_source.Text = @"\p \v 1 w!Forming";

            List <TextTokenSubstring> tts = check.GetReferences(m_source.TextTokens(), null);

            Assert.AreEqual(0, tts.Count);

            m_source.m_extraWordFormingCharacters = "!";

            tts = check.GetReferences(m_source.TextTokens(), null);

            Assert.AreEqual(1, tts.Count);
            Assert.AreEqual("w!Forming", tts[0].Text);
        }
		public void ChangeCharacterCategorizerAfterInstantiationOfCheck()
		{
			MixedCapitalizationCheck check = new MixedCapitalizationCheck(m_source);

			m_source.Text = @"\p \v 1 w!Forming";

			List<TextTokenSubstring> tts = check.GetReferences(m_source.TextTokens(), null);

			Assert.AreEqual(0, tts.Count);

			m_source.m_extraWordFormingCharacters = "!";

			tts = check.GetReferences(m_source.TextTokens(), null);

			Assert.AreEqual(1, tts.Count);
			Assert.AreEqual("w!Forming", tts[0].Text);
		}