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);
        }
Esempio n. 2
0
        public void InnerConclude()
        {
            const string input  = @"<code language=""ruby"">return &#39;3 < 5&#39;</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);
 }
Esempio n. 4
0
        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 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 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);
        }
Esempio n. 7
0
    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);
    }
Esempio n. 8
0
        public void BuildCodeElementString()
        {
            var actual = CodeBlockModifier.BuildCodeElementString("(", "ruby", "r.to_html", ")");

            Assert.AreEqual(@"(<code language=""ruby"">r.to_html</code>)", actual);
        }
Esempio n. 9
0
        public void InnerModifyLine()
        {
            var actual = CodeBlockModifier.InnerModifyLine("(@|ruby|r.to_html@)");

            Assert.AreEqual(@"(<code language=""ruby"">r.to_html</code>)", actual);
        }