Beispiel #1
0
        public void EnsureStyle_adds_style_if_not_exists(DocumentStyleType type)
        {
            var documentStyle = new DocumentStyle()
            {
                StyleName = "test", DocumentStyleType = type
            };

            var ensureStyle = documentStyle.Ensure(Document);

            ensureStyle.ShouldBeTrue();

            documentStyle.Find(Document).Name().ShouldBe("test");
        }
Beispiel #2
0
        public void EnsureStyle_Update_style_if_not_used(DocumentStyleType type)
        {
            var nativeStyle = Document.NewDocumentStyle(1, type, true).First();

            nativeStyle.FontName = "test";
            var documentStyle = new DocumentStyle()
            {
                StyleName = nativeStyle.Name(), DocumentStyleType = type
            };

            var ensureStyle = documentStyle.Ensure(Document);

            ensureStyle.ShouldBeTrue();

            documentStyle.Find(Document).FontName.ShouldBe("test");
        }