コード例 #1
0
        public void ConstructHtml_WHEN_Token_Does_Not_Have_Url_Property_Name_THEN_Returns_Empty_String()
        {
            dynamic t = new Token(TokenType.Delimiter, "#a", 1, 1);
            t.IsStartingDelimeter = true;

            var hrefParseRule = new HrefParseRule();
            string htmlFragment = hrefParseRule.ConstructHtml(t);

            htmlFragment.ShouldEqual(String.Empty);
        }
コード例 #2
0
        public void ConstructHtml_WHEN_Token_Has_Url_Property_Name_THEN_Return_HTML_For_href()
        {
            const string Url = "http://www.jumbleblocks.com";

            dynamic t = new Token(TokenType.Delimiter, "#a", 1, 1);
            t.Url = Url;
            t.IsStartingDelimeter = true;

            var hrefParseRule = new HrefParseRule();
            string htmlFragment = hrefParseRule.ConstructHtml(t);

            htmlFragment.ShouldEqual(String.Format("href='{0}'", Url));
        }