示例#1
0
        public void OneTimeSetUp()
        {
            // Cases we want to test:
            // - there are more blocks on the last page after we run out of input lines
            // - there are pages after the last input line
            //		- V1: warn, leave unchanged.
            //		- eventual: ?
            // In this test suite, lines run out before the blocks.
            _dom   = new HtmlDom(inputBook, true);
            _sheet = new InternalSpreadsheet();
            _sheet.ColumnForLang("en");
            _sheet.ColumnForLang("fr");
            _sheet.AddRow(SpreadsheetImportSyncWarnings.MakeRow("1", "New message about tigers", "New message about French tigers"));
            _sheet.AddRow(SpreadsheetImportSyncWarnings.MakeRow("2", "More about tigers", "More about French tigers"));
            // problem: there's no input corresponding to the second block on page 2, nor any of page 4.
            var importer = new SpreadsheetImporter(this._dom, _sheet);

            _messages = importer.Import();
        }
示例#2
0
        public void OneTimeSetUp()
        {
            // Cases we want to test:
            // - page has too many translation groups
            //		- V1: warn, leave extras unmodified
            //		- eventual: ?
            // - page has too few translation groups (special case: none)
            //		- V1: warn, drop extra inputs
            //		- V2: insert extra copies of page (and something else if it has no TGs)
            //		- eventual: insert extra pages using template specified in sheet
            // - there are input lines for pages that don't exist (pathological, in the middle; likely, after last; test both)
            //		- V1: warn, ignore
            //		- eventual: insert extra pages using template specified in sheet
            // - there are pages that have no input lines (but later pages do)
            // - there are pages after the last input line
            //		- V1: warn, leave unchanged.
            //		- eventual: ?
            // In this test suite, the blocks on the last page and the pages run out before
            // we run out of lines. So we can't test the case of running out of lines first.
            // Another class tests that.
            _dom   = new HtmlDom(inputBook, true);
            _sheet = new InternalSpreadsheet();
            _sheet.ColumnForLang("en");
            _sheet.ColumnForLang("fr");
            _sheet.AddRow(MakeRow("1", "New message about tigers", "New message about French tigers"));
            // problem 1: input DOM has a second TG on page 1; sheet does not.
            _sheet.AddRow(MakeRow("2", "More about tigers", "More about French tigers"));
            // problem 2: input DOM has no second TG on page 2.
            _sheet.AddRow(MakeRow("2", "Still more about tigers", "Still more about French tigers"));
            _sheet.AddRow(MakeRow("2", "More and more about tigers", "More and more about French tigers"));
            // problem 3: input DOM has no page 3 at all.
            _sheet.AddRow(MakeRow("3", "Lost story about tigers", "Lost story about French tigers"));
            _sheet.AddRow(MakeRow("3", "Another lost story about tigers", "Another lost story about French tigers"));
            // problem 4: input DOM has no page 4 at all.
            _sheet.AddRow(MakeRow("4", "Yet another lost story about tigers", "Yet another lost story about French tigers"));
            _sheet.AddRow(MakeRow("5", "A good story about tigers", "A good story about French tigers"));
            _sheet.AddRow(MakeRow("5", "Another good story about tigers", "Another good story about French tigers"));
            // problem 5: an extra block on page 5
            _sheet.AddRow(MakeRow("5", "Page 5 lost story about tigers", "Page 5 lost story about French tigers"));
            // problem 6: an extra block on after the last page
            _sheet.AddRow(MakeRow("6", "Page 6 lost story about tigers", "Page 6 lost story about French tigers"));
            var importer = new SpreadsheetImporter(this._dom, _sheet);

            _messages = importer.Import();
        }