//**UnFormat**: Turns other special chars into text. ie: "\u00a0" --> " " (..unicodeSpaceTest) //Removes whitespace at ends (..FitNesseStandardVersionTest) //Removes html tag?? (..FitNesseStandardVersionTest) private string UnFormat(string theInput) { TextOutput result = new TextOutput(); while (theInput.Length > 0) { string leader = FindLeader(theInput); result.Append(leader); string tag = FindTagAndTrim(ref theInput); if (tag.Length == 0) break; if (fitSharp.Parser.HtmlString.IsStandard) result.AppendTag(GetTag(tag)); //Should not have tags } return result.ToString(); }
public void TestOutputFormatsParagraphTagsCorrectlyTest() { StringBuilder myText = new StringBuilder("<"); string myLastTag = "/p "; string input = "p"; string expected = "<br />"; TextOutput textOutput = new TextOutput(); ReflectionHelper.SetField(textOutput, "myText", myText); ReflectionHelper.SetField(textOutput, "myLastTag", myLastTag); textOutput.AppendTag(input); StringBuilder result = (StringBuilder)ReflectionHelper.GetField<object>(textOutput, "myText"); Assert.AreEqual(expected, result.ToString()); }