Esempio n. 1
0
        public virtual void MatchTest()
        {
            MediaDeviceDescription deviceDescription = new MediaDeviceDescription("all");
            MediaQuery             query             = MediaQueryParser.ParseMediaQuery("not all and (min-width: 600px)");
            IList <MediaQuery>     queries           = MediaQueryParser.ParseMediaQueries("not all and (min-width: 600px), not all and (min-width: 500px)"
                                                                                          );

            NUnit.Framework.Assert.IsTrue(query.Matches(deviceDescription));
            NUnit.Framework.Assert.IsTrue(queries[0].Matches(deviceDescription));
            NUnit.Framework.Assert.IsTrue(queries[1].Matches(deviceDescription));
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a
 /// <see cref="CssMediaRule"/>.
 /// </summary>
 /// <param name="ruleParameters">the rule parameters</param>
 public CssMediaRule(String ruleParameters)
     : base(CssRuleName.MEDIA, ruleParameters)
 {
     mediaQueries = MediaQueryParser.ParseMediaQueries(ruleParameters);
 }