Esempio n. 1
0
        public void Can_InValidate_Stylesheet()
        {
            // Arrange
            var stylesheet = new Stylesheet("/css/styles.css");
            stylesheet.Content = @"body { color:#000; } .bold font-weight:bold;}";

            // Assert
            Assert.That(stylesheet.IsFileValidCss(), Is.False);
            Assert.That(stylesheet.IsValid(), Is.True);
        }
Esempio n. 2
0
        public void Can_Validate_Css3_Stylesheet()
        {
            // Arrange
            var stylesheet = new Stylesheet("/css/styles.css");
            stylesheet.Content = "@media screen and (min-width: 768px) { body {background: red}}";

            // Assert
            Assert.That(stylesheet.IsFileValidCss(), Is.True);
            Assert.That(stylesheet.IsValid(), Is.True);
        }
Esempio n. 3
0
 /// <summary>
 /// Validates a <see cref="Stylesheet"/>
 /// </summary>
 /// <param name="stylesheet"><see cref="Stylesheet"/> to validate</param>
 /// <returns>True if Stylesheet is valid, otherwise false</returns>
 public bool ValidateStylesheet(Stylesheet stylesheet)
 {
     return stylesheet.IsValid() && stylesheet.IsFileValidCss();
 }
Esempio n. 4
0
        public void Can_Verify_Mixed_Css_Css3_Property_From_Css()
        {
            // Arrange
            var stylesheet = new Stylesheet("/css/styles.css");
            stylesheet.Content = @"@media screen and (min-width: 600px) and (min-width: 900px) {
                                      .class {
                                        background: #666;
                                      }
                                    }";

            // Act
            var properties = stylesheet.Properties;

            // Assert
            Assert.That(stylesheet.IsFileValidCss(), Is.True);
            Assert.That(properties, Is.Not.Null);
            Assert.That(properties.Any(), Is.True);
        }