Example #1
0
        public void GetName()
        {
            var provider = new StylesProvider();
            var name     = provider.GetName(1);

            Assert.AreEqual("Heading 2", name);
        }
Example #2
0
        public void GetCount()
        {
            var provider = new StylesProvider();
            int count    = provider.GetCount();

            Assert.AreEqual(15, count);
        }
Example #3
0
        public void GetStyle()
        {
            var provider = new StylesProvider();

            using (var style = provider.GetStyle(1))
            {
                Assert.IsNotNull(style);
                Assert.AreEqual("Heading 2", style.Name);
                Assert.IsTrue(style.IsHeading);
            }
        }
Example #4
0
        public void GetStyles()
        {
            var provider = new StylesProvider();
            var styles   = provider.GetStyles();

            Assert.IsNotNull(styles);
            Assert.AreEqual(15, styles.Count);

            foreach (var style in styles)
            {
                style.Dispose();
            }
        }
Example #5
0
        public void Filter()
        {
            var provider = new StylesProvider();

            var styles = provider.Filter(
                f => f.Attributes("isHeading").Any(a => a.Value.ToLower()
                                                   .Equals("true", StringComparison.InvariantCultureIgnoreCase)));

            Assert.IsNotNull(styles);
            Assert.AreEqual(6, styles.Count());

            foreach (var style in styles)
            {
                var a = style.Attribute("isHeading");
                Assert.IsNotNull(a);
                Assert.AreEqual("true", a.Value);
            }
        }