public virtual void MergeParentDeclarationsMeasurementInheritTest()
        {
            IDictionary <String, String> styles = new Dictionary <String, String>();
            String styleProperty   = "font-size";
            String parentPropValue = "16cm";
            String parentFontSize  = "0";
            IDictionary <String, String> expectedStyles = new Dictionary <String, String>();

            expectedStyles.Put(styleProperty, parentPropValue);
            StyleResolverUtil sru = new StyleResolverUtil();

            sru.MergeParentStyleDeclaration(styles, styleProperty, parentPropValue, parentFontSize);
            bool equal = styles.Count == expectedStyles.Count;

            foreach (KeyValuePair <String, String> kvp in expectedStyles)
            {
                equal &= kvp.Value.Equals(styles.Get(kvp.Key));
            }
            NUnit.Framework.Assert.IsTrue(equal);
        }
        public virtual void MergeParentDeclarationsTextDecorationsTest()
        {
            IDictionary <String, String> styles = new Dictionary <String, String>();
            String styleProperty = "text-decoration";

            styles.Put(styleProperty, "strikethrough");
            String parentPropValue = "underline";
            String parentFontSize  = "0";
            IDictionary <String, String> expectedStyles = new Dictionary <String, String>();

            expectedStyles.Put(styleProperty, "strikethrough underline");
            StyleResolverUtil sru = new StyleResolverUtil();

            sru.MergeParentStyleDeclaration(styles, styleProperty, parentPropValue, parentFontSize);
            bool equal = styles.Count == expectedStyles.Count;

            foreach (KeyValuePair <String, String> kvp in expectedStyles)
            {
                equal &= kvp.Value.Equals(styles.Get(kvp.Key));
            }
            NUnit.Framework.Assert.IsTrue(equal);
        }
예제 #3
0
 public SvgNodeRendererInheritanceResolver()
 {
     sru = new StyleResolverUtil();
 }