Пример #1
0
        public void GetTagAttributesEmpty()
        {
            var op = new DeltaInsertOp("hello");
            var c  = new OpToXmlConverter(op);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] { });
        }
Пример #2
0
        public void GetTagAttributesEmptyText()
        {
            var o = new DeltaInsertOp("",
                                      new OpAttributes {
                Code = true, Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] { });
        }
Пример #3
0
        public void GetTagAttributesFormulaIgnoresColour()
        {
            var o = new DeltaInsertOp(new InsertDataFormula("-"),
                                      new OpAttributes {
                Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-formula")
            });
        }
Пример #4
0
        public void GetTagAttributesLinkUsesColour()
        {
            var o = new DeltaInsertOp("link",
                                      new OpAttributes {
                Color = "red", Link = "l"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("style", "color:red"),
                new TagKeyValue("href", "l")
            });
        }
Пример #5
0
        public void GetTagAttributesImageIgnoresColour()
        {
            var o = new DeltaInsertOp(new InsertDataImage("http:"),
                                      new OpAttributes {
                Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-image"),
                new TagKeyValue("src", "http:")
            });
        }
Пример #6
0
        public void GetTagAttributesImageIncludesWidth()
        {
            var o = new DeltaInsertOp(new InsertDataImage("http:"),
                                      new OpAttributes {
                Width = "200"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-image"),
                new TagKeyValue("width", "200"),
                new TagKeyValue("src", "http:")
            });
        }
Пример #7
0
        public void GetTagAttributesVideoIgnoresColour()
        {
            var o = new DeltaInsertOp(new InsertDataVideo("http:"),
                                      new OpAttributes {
                Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-video"),
                new TagKeyValue("frameborder", "0"),
                new TagKeyValue("allowfullscreen", "true"),
                new TagKeyValue("src", "http:")
            });
        }
Пример #8
0
        public void GetTagAttributesLinkNoFollowOptionWorks()
        {
            var o = new DeltaInsertOp("link",
                                      new OpAttributes {
                Color = "red", Link = "l"
            });
            var c = new OpToXmlConverter(o,
                                         new OpToXmlConverterOptions {
                LinkRel = "nofollow"
            });

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("style", "color:red"),
                new TagKeyValue("href", "l"),
                new TagKeyValue("rel", "nofollow")
            });
        }