Ejemplo n.º 1
0
 public void GetAnyBrokenRulesErrorCount(int Id, ICSSFragment content, int expectedErrors)
 {
     Assert.Equal(
         expectedErrors,
         AllMeasurementsMustBePixels.Recommended.GetAnyBrokenRules(new[] { content }).Count()
         );
 }
 public void GetAnyBrokenRulesErrorCount(int Id, ICSSFragment content, int expectedErrors)
 {
     Assert.Equal(
         expectedErrors,
         HtmlTagScopingMustBeAppliedToNonResetsOrThemesSheets.Instance.GetAnyBrokenRules(new[] { content }).Count()
         );
 }
Ejemplo n.º 3
0
 public void GetAnyBrokenRulesCount(int Id, ICSSFragment content, int expectedErrors)
 {
     Assert.Equal(
         expectedErrors,
         PaddingMustBeFullySpecifiedIfSpecifiedAtAll.Instance.GetAnyBrokenRules(new[] { content }).Count()
         );
 }
Ejemplo n.º 4
0
        public BrokenRuleEncounteredException(string message, ICSSFragment fragment) : base((message ?? "").Trim())
        {
            if (string.IsNullOrWhiteSpace(message))
            {
                throw new ArgumentException("Null/blank message specified");
            }

            Fragment = fragment;
        }
Ejemplo n.º 5
0
            public NoSelectorMayBeRepeatedInTheRulesException(ICSSFragment fragment, string selector) : base("Selector encountered multiple times: " + (selector ?? ""), fragment)
            {
                if (string.IsNullOrWhiteSpace(selector))
                {
                    throw new ArgumentException("Null/blank selector specified");
                }

                Selector = selector.Trim();
            }
Ejemplo n.º 6
0
            public SelectorSetWithSourceFragment(ContainerFragment.SelectorSet selector, ICSSFragment source)
            {
                if (selector == null)
                {
                    throw new ArgumentNullException("selector");
                }
                if (source == null)
                {
                    throw new ArgumentNullException("source");
                }

                Selector = selector;
                Source   = source;
            }
Ejemplo n.º 7
0
 public PaddingMustBeFullySpecifiedIfSpecifiedAtAllException(ICSSFragment fragment) : base("Style block encountered with incomplete padding specification", fragment)
 {
 }
 public BorderWidthMustBeFullySpecifiedIfSpecifiedAtAllException(ICSSFragment fragment) : base("Style block encountered with incomplete border width specification", fragment)
 {
 }
 public ScopeRestrictingHtmlTagNotAppliedException(ICSSFragment fragment) : base("Scope-restricting html tag not applied", fragment)
 {
 }
 public AllMeasurementsMustBePixelsNotAppliedException(string additionalMessageContent, ICSSFragment fragment)
     : base("Measurement encountered that was not in pixels: " + (additionalMessageContent ?? ""), fragment)
 {
     if (string.IsNullOrWhiteSpace(additionalMessageContent))
     {
         throw new ArgumentException("Null/blank additionalMessageContent specified");
     }
 }
 public AllMeasurementsMustBePixelsNotAppliedException(ICSSFragment fragment) : base("Measurement encountered that was not in pixels", fragment)
 {
 }
        public void EmptyContentReturnsNoBrokenRules()
        {
            var content = new ICSSFragment[0];

            Assert.Empty(HtmlTagScopingMustBeAppliedToNonResetsOrThemesSheets.Instance.GetAnyBrokenRules(content));
        }
        public void EmptyContentIsAcceptable()
        {
            var content = new ICSSFragment[0];

            HtmlTagScopingMustBeAppliedToNonResetsOrThemesSheets.Instance.EnsureRulesAreMet(content);
        }
Ejemplo n.º 14
0
 public BorderAndPaddingMayNotBeCombinedWithWidthException(ICSSFragment fragment) : base("Style block encountered that combines border and/or padding with width", fragment)
 {
 }
Ejemplo n.º 15
0
        public void EmptyContentIsAcceptable_ScopeRestrictingHtmlTagDisallowed()
        {
            var content = new ICSSFragment[0];

            (new NoBareSelectorsInNonResetsOrThemeSheets(NoBareSelectorsInNonResetsOrThemeSheets.ScopeRestrictingHtmlTagBehaviourOptions.Disallow)).EnsureRulesAreMet(content);
        }