Exemplo n.º 1
0
        public virtual void GetCssRuleSetsTest()
        {
            MediaDeviceDescription deviceDescription = new MediaDeviceDescription("all");
            String             html     = "<a id=\"123\" class=\"baz = 'bar'\" style = media= all and (min-width: 600px) />";
            IDocumentNode      node     = new JsoupHtmlParser().Parse(html);
            IList <CssRuleSet> ruleSets = new CssMediaRule("only all and (min-width: 600px) and (min-height: 600px)").GetCssRuleSets
                                              (node, deviceDescription);

            NUnit.Framework.Assert.IsNotNull(ruleSets);
        }
Exemplo n.º 2
0
        public virtual void MatchMediaDeviceTest()
        {
            MediaDeviceDescription deviceDescription = new MediaDeviceDescription("all");

            deviceDescription.SetHeight(450);
            deviceDescription.SetWidth(600);
            CssMediaRule rule = new CssMediaRule("@media all and (min-width: 600px) and (min-height: 600px)");

            NUnit.Framework.Assert.IsTrue(rule.MatchMediaDevice(deviceDescription));
        }