Example #1
0
        public void CssTokenizerOnlyLineFeed()
        {
            var teststring = "\n";
            var tokenizer  = new CssTokenizer(new TextSource(teststring));
            var token      = tokenizer.NextToken();

            Assert.Equal("\n", token.Data);
        }
Example #2
0
        public void CssTokenizerOnlyCarriageReturn()
        {
            var teststring = "\r";
            var tokenizer  = new CssTokenizer(new TextSource(teststring));
            var token      = tokenizer.NextToken();

            Assert.Equal("\n", token.Data);
        }
Example #3
0
        public void CssParserAtRule()
        {
            var teststring = "@media { background: blue; }";
            var tokenizer  = new CssTokenizer(new TextSource(teststring));
            var token      = tokenizer.NextToken();

            Assert.Equal(CssTokenType.AtKeyword, token.Type);
        }
Example #4
0
        public void CssParserIdentifier()
        {
            var teststring = "h1 { background: blue; }";
            var tokenizer  = new CssTokenizer(new TextSource(teststring));
            var token      = tokenizer.NextToken();
            var type       = typeof(string).GetType().GetField("");

            Assert.Equal(CssTokenType.Ident, token.Type);
        }
Example #5
0
        public void CssParserUrlSingleQuoted()
        {
            var url        = "http://someurl";
            var teststring = "url('" + url + "')";
            var tokenizer  = new CssTokenizer(new TextSource(teststring));
            var token      = tokenizer.NextToken();

            Assert.Equal(url, token.Data);
        }