Exemplo n.º 1
0
        public void FixHyphensAddTest()
        {
            string test1     = "<font color=\"#008080\">- Foobar." + Environment.NewLine + "Foobar.</font>";
            string expected1 = "<font color=\"#008080\">- Foobar." + Environment.NewLine + "- Foobar.</font>";

            string test2     = "<i>Foobar.</i>" + Environment.NewLine + "- Foobar.";
            var    expected2 = "<i>- Foobar.</i>" + Environment.NewLine + "- Foobar.";

            var sub = new Subtitle();

            sub.Paragraphs.Add(new Paragraph(test1, 0000, 11111));
            sub.Paragraphs.Add(new Paragraph(test2, 0000, 11111));

            string output1 = FixCommonErrorsHelper.FixHyphensAdd(sub, 0, "en");
            string output2 = FixCommonErrorsHelper.FixHyphensAdd(sub, 1, "en");

            Assert.AreEqual(output1, expected1);
            Assert.AreEqual(output2, expected2);
        }
Exemplo n.º 2
0
        public void FixHyphensAddTest()
        {
            var test1     = @"<font color=""#008080"">- Foobar.
Foobar.</font>";
            var expected1 = @"<font color=""#008080"">- Foobar.
- Foobar.</font>";

            var test2     = @"<i>Foobar.</i>
- Foobar.";
            var expected2 = @"<i>- Foobar.</i>
- Foobar.";
            var sub       = new Subtitle();

            sub.Paragraphs.Add(new Paragraph(test1, 0000, 11111));
            sub.Paragraphs.Add(new Paragraph(test2, 0000, 11111));

            string output1 = FixCommonErrorsHelper.FixHyphensAdd(sub, 0, "en");
            string output2 = FixCommonErrorsHelper.FixHyphensAdd(sub, 1, "en");

            Assert.AreEqual(output1, expected1); Assert.AreEqual(output2, expected2);
        }