Ejemplo n.º 1
0
        public void MicroDvdBold()
        {
            var target   = new MicroDvd();
            var subtitle = new Subtitle();

            subtitle.Paragraphs.Add(new Paragraph("<b>Bold</b>", 0, 0));
            string text = target.ToText(subtitle, "title");

            Assert.IsTrue(text == "{0}{0}{Y:b}Bold" || text == "{0}{0}{y:b}Bold");
        }
Ejemplo n.º 2
0
        public void MicroDvdItalicUnderline()
        {
            var target   = new MicroDvd();
            var subtitle = new Subtitle();

            subtitle.Paragraphs.Add(new Paragraph("<i><u>Underline Italic</u></i>", 0, 0));
            string text = target.ToText(subtitle, "title");

            Assert.IsTrue(text == "{0}{0}{Y:i}{Y:u}Underline Italic" || text == "{0}{0}{y:i}{y:u}Underline Italic");
        }
Ejemplo n.º 3
0
        public void MicroDvdReadBoldSecondLineOnly()
        {
            var           target   = new MicroDvd();
            var           subtitle = new Subtitle();
            List <string> list     = new List <string>();

            list.Add("{0}{0}Hello!|{y:i}Hello!");
            target.LoadSubtitle(subtitle, list, null);
            string text = subtitle.Paragraphs[0].Text;

            Assert.IsTrue(text == "Hello!" + Environment.NewLine + "<i>Hello!</i>");
        }
Ejemplo n.º 4
0
        public void MicroDvdReadAdvanced()
        {
            var           target   = new MicroDvd();
            var           subtitle = new Subtitle();
            List <string> list     = new List <string>();

            list.Add("{0}{25}{c:$0000ff}{y:b,u}{f:DeJaVuSans}{s:12}Hello!");
            target.LoadSubtitle(subtitle, list, null);
            string text = subtitle.Paragraphs[0].Text;

            Assert.IsTrue(text == "<font color=\"#ff0000\"><b><u><font face=\"DeJaVuSans\"><font size=\"12\">Hello!</font></font></u></b></font>");
        }
Ejemplo n.º 5
0
        public void MicroDvdReadFont()
        {
            var           target   = new MicroDvd();
            var           subtitle = new Subtitle();
            List <string> list     = new List <string>();

            list.Add("{0}{0}{C:$FF0000}Blue");
            target.LoadSubtitle(subtitle, list, null);
            string text = subtitle.Paragraphs[0].Text;

            Assert.IsTrue(text == "<font color=\"#0000FF\">Blue</font>" || text == "<font color=\"blue\">Blue</font>");
        }
Ejemplo n.º 6
0
        public void MicroDvdReadBoldItalic()
        {
            var           target   = new MicroDvd();
            var           subtitle = new Subtitle();
            List <string> list     = new List <string>();

            list.Add("{0}{0}{y:i,b}Hello!");
            target.LoadSubtitle(subtitle, list, null);
            string text = subtitle.Paragraphs[0].Text;

            Assert.IsTrue(text == "<i><b>Hello!</b></i>");
        }
Ejemplo n.º 7
0
        public void MicroDvdReadBoldFirstLineOnly()
        {
            var target   = new MicroDvd();
            var subtitle = new Subtitle();
            var list     = new List <string> {
                "{0}{0}{y:i}Hello!|Hello!"
            };

            target.LoadSubtitle(subtitle, list, null);
            string text = subtitle.Paragraphs[0].Text;

            Assert.IsTrue(text == "<i>Hello!</i>" + Environment.NewLine + "Hello!");
        }
Ejemplo n.º 8
0
        public void MicroDvdReadBoldBothLinesItalicFirst()
        {
            var           target   = new MicroDvd();
            var           subtitle = new Subtitle();
            List <string> list     = new List <string>();

            list.Add("{0}{0}{Y:b}{y:i}Hello!|Hello!");
            target.LoadSubtitle(subtitle, list, null);
            string text = subtitle.Paragraphs[0].Text;

            Assert.IsTrue(text == "<b><i>Hello!</i>" + Environment.NewLine + "Hello!</b>" ||
                          text == "<b><i>Hello!</i></b>" + Environment.NewLine + "<b>Hello!</b>");
        }