public void ModifyLine() { var cbm = new CodeBlockModifier(); var actual = cbm.ModifyLine("(@|ruby|r.to_html@)"); Assert.AreEqual(@"(<code language=""ruby"">r.to_html</code>)", actual); }
public void InnerConclude() { const string input = @"<code language=""ruby"">return '3 < 5'</code>"; var actual = CodeBlockModifier.InnerConclude(input); Assert.AreEqual(@"<code language=""ruby"">return '3 < 5'</code>", actual); }
public void ModifyLine() { var cbm = new CodeBlockModifier(); const string input = "Call the @|ruby|r_tohtml();@ method"; var actual = cbm.ModifyLine(input); const string expected = "Call the <code language=\"ruby\">r_tohtml();</code> method"; Assert.AreEqual(expected, actual); }
public void PhraseModifierFormatTestCode() { string input = "Convert with @r.to_html@"; string expected = "Convert with <code>r.to_html</code>"; CodeBlockModifier f = new CodeBlockModifier(); string actual = FormatLine(f, input); Assert.AreEqual(expected, actual); }
public void CodeFormatMatchEvaluator() { var m = Regex.Match( "Call the ruby r_tohtml(); method", @"(?<before>Call\sthe\s)" + @"(?<lang>ruby)\s" + @"(?<code>r_tohtml\(\);)" + @"(?<after>\smethod)" ); var actual = CodeBlockModifier.CodeFormatMatchEvaluator(m); Assert.AreEqual("Call the <code language=\"ruby\">r_tohtml();</code> method", actual); }
public void BuildCodeElementString() { var actual = CodeBlockModifier.BuildCodeElementString( "Call the ", "ruby", "r_tohtml();", " method" ); const string expected = "Call the <code language=\"ruby\">r_tohtml();</code> method"; Assert.AreEqual(expected, actual); }
public void BuildCodeElementString() { var actual = CodeBlockModifier.BuildCodeElementString("(", "ruby", "r.to_html", ")"); Assert.AreEqual(@"(<code language=""ruby"">r.to_html</code>)", actual); }
public void InnerModifyLine() { var actual = CodeBlockModifier.InnerModifyLine("(@|ruby|r.to_html@)"); Assert.AreEqual(@"(<code language=""ruby"">r.to_html</code>)", actual); }