Ejemplo n.º 1
0
 public void WhenParseMultilineComment_ThenReturnCommentPerLine()
 {
     var parser = new CssCommentParser();
     var comments = parser.Parse("/*text1\r\ntext2*/").ToArray();
     comments[0].LineNumber.ShouldEqual(1);
     comments[0].Value.ShouldEqual("text1");
     comments[1].LineNumber.ShouldEqual(2);
     comments[1].Value.ShouldEqual("text2");
 }
Ejemplo n.º 2
0
 public void WhenNewLinesBeforeComments_ThenReturnCommentsWithCorrectLineNumbers()
 {
     var parser = new CssCommentParser();
     var comments = parser.Parse("\r\n/*text1*/\r\n\r\n/*text2*/").ToArray();
     comments[0].LineNumber.ShouldEqual(2);
     comments[0].Value.ShouldEqual("text1");
     comments[1].LineNumber.ShouldEqual(4);
     comments[1].Value.ShouldEqual("text2");
 }
Ejemplo n.º 3
0
        public void WhenNewLinesBeforeComments_ThenReturnCommentsWithCorrectLineNumbers()
        {
            var parser   = new CssCommentParser();
            var comments = parser.Parse("\r\n/*text1*/\r\n\r\n/*text2*/").ToArray();

            comments[0].LineNumber.ShouldEqual(2);
            comments[0].Value.ShouldEqual("text1");
            comments[1].LineNumber.ShouldEqual(4);
            comments[1].Value.ShouldEqual("text2");
        }
Ejemplo n.º 4
0
        public void WhenParseMultilineCommentWithUnixNewLines_ThenReturnCommentPerLine()
        {
            var parser   = new CssCommentParser();
            var comments = parser.Parse("/*text1\ntext2*/").ToArray();

            comments[0].LineNumber.ShouldEqual(1);
            comments[0].Value.ShouldEqual("text1");
            comments[1].LineNumber.ShouldEqual(2);
            comments[1].Value.ShouldEqual("text2");
        }