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() ); }
public void GetAnyBrokenRulesCount(int Id, ICSSFragment content, int expectedErrors) { Assert.Equal( expectedErrors, PaddingMustBeFullySpecifiedIfSpecifiedAtAll.Instance.GetAnyBrokenRules(new[] { content }).Count() ); }
public BrokenRuleEncounteredException(string message, ICSSFragment fragment) : base((message ?? "").Trim()) { if (string.IsNullOrWhiteSpace(message)) { throw new ArgumentException("Null/blank message specified"); } Fragment = fragment; }
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(); }
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; }
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); }
public BorderAndPaddingMayNotBeCombinedWithWidthException(ICSSFragment fragment) : base("Style block encountered that combines border and/or padding with width", fragment) { }
public void EmptyContentIsAcceptable_ScopeRestrictingHtmlTagDisallowed() { var content = new ICSSFragment[0]; (new NoBareSelectorsInNonResetsOrThemeSheets(NoBareSelectorsInNonResetsOrThemeSheets.ScopeRestrictingHtmlTagBehaviourOptions.Disallow)).EnsureRulesAreMet(content); }