Esempio n. 1
0
        public void RemoveUnityTags_AllUnityTags_ReturnsNoTags( )
        {
            //"b", "i", "size", "color", "style" };
            var textToType    = "<b>a</b><i>b</i><size=40>c</size><color=red>d</color><style=C1>e</style>";
            var generatedText = TextTagParser.RemoveUnityTags(textToType);

            var expectedText = "abcde";

            Assert.AreEqual(expectedText, generatedText);
        }
Esempio n. 2
0
        public void RemoveUnityTags_SpriteTagWithValue_ReturnsTaglessText()
        {
            var builder       = new System.Text.StringBuilder();
            var textToType    = "This string has a <sprite index=0> sprite.";
            var generatedText = TextTagParser.RemoveUnityTags(textToType);

            var expectedText = "This string has a  sprite.";

            Assert.AreEqual(expectedText, generatedText);
        }
Esempio n. 3
0
        public void RemoveUnityTags_AllUnityTags_ReturnsNoTags()
        {
            var builder             = new System.Text.StringBuilder();
            var expectedTextBuilder = new System.Text.StringBuilder();

            for (int i = 0; i < UnityTags.Length; ++i)
            {
                var tag = UnityTags[i];
                builder.Append($"<{tag}>{i}</{tag}>");
                expectedTextBuilder.Append($"{i}");
            }

            var textToType    = builder.ToString();
            var generatedText = TextTagParser.RemoveUnityTags(textToType);

            var expectedText = expectedTextBuilder.ToString();

            Assert.AreEqual(expectedText, generatedText);
        }