예제 #1
0
        public override void Init()
        {
            base.Init();

            Thread.Sleep(500);

            // Select "File/Import/Standard Format" to bring up the import dialog
            m_app.SendKeys("%F");
            m_app.SendKeys("{DOWN 8}");
            m_app.SendKeys("{ENTER}");
            m_app.SendKeys("{ENTER}");
            Application.DoEvents();

            AccessibilityHelper importDlg =
                m_app.MainAccessibilityHelper.Parent.FindDirectChild("Import Standard Format",
                                                                     AccessibleRole.None);

            // select the "Import" button which is the default button
            if (importDlg != null)
            {
                m_app.SendKeys("{ENTER}");
            }

            Application.DoEvents();

            m_dialog = m_app.MainAccessibilityHelper.Parent.FindDirectChild(
                "Import Standard Format", AccessibleRole.None);

            m_saveRegistryData = Unpacker.PrepareRegistryForPTData();
        }
예제 #2
0
        public void DataFormatPage()
        {
            Assert.IsNotNull(m_dialog, "Didn't get an Import dialog");

            m_app.SendKeys("%N");
            Application.DoEvents();

            AccessibilityHelper step2 = m_dialog.FindChild("Step 2", AccessibleRole.None);

            Assert.IsNotNull(step2, "Can't find Step 2");

            // first test with Paratext "installed"
            int nRequiredRbs = 0;

            CheckRadioButtons(step2, ref nRequiredRbs);
            Assert.AreEqual(2, nRequiredRbs, "Unexpected number of radio buttons");

            // then without
            //TODO DavidO: Unsure of these changes; need to fix and reenable this test
            //PrepareParatextProjectTestData.RestoreRegistry();
            //PrepareParatextProjectTestData.TestFolder = null;
            //PrepareParatextProjectTestData.PrepareRegistryForTestData();
            m_saveRegistryData.RestoreRegistryData();
            //Unpacker.TEStyleFileTestFolder = null;
            m_saveRegistryData = Unpacker.PrepareRegistryForPTData();

            // go back to overview page and then go again to second step
            m_app.SendKeys("%B");
            m_app.SendKeys("%N");
            Application.DoEvents();

            nRequiredRbs = 0;
            CheckRadioButtons(step2, ref nRequiredRbs);
            Assert.AreEqual(2, nRequiredRbs, "Unexpected number of radio buttons");
        }
예제 #3
0
        public override void FixtureSetup()
        {
            CheckDisposed();
            base.FixtureSetup();

            Unpacker.UnPackParatextTestProjects();
            m_regData = Unpacker.PrepareRegistryForPTData();
        }
예제 #4
0
        public override void FixtureSetup()
        {
            base.FixtureSetup();

            Unpacker.UnPackParatextTestProjects();
            m_regData = Unpacker.PrepareRegistryForPTData();

            m_fdoCache = FdoCache.Create("TestLangProj");
            m_scr      = (Scripture)m_fdoCache.LangProject.TranslatedScriptureOA;
            ScrReferenceTests.InitializeScrReferenceForTests();
        }
예제 #5
0
        public override void FixtureSetup()
        {
            CheckDisposed();
            base.FixtureSetup();

            Unpacker.UnPackParatextTestProjects();
            m_regData = Unpacker.PrepareRegistryForPTData();

            // TeApp derives from FwApp
            m_testTeApp = new TestTeApp(new string[] {
                "-c", m_sSvrName,                                                                                                               // ComputerName (aka the SQL server)
                "-proj", m_ProjName,                                                                                                            // ProjectName
                "-db", m_sDbName
            });                                                                                                                                 // DatabaseName

            m_fMainWindowOpened = m_testTeApp.OpenMainWindow();
        }
예제 #6
0
        public void Init()
        {
            CheckDisposed();

            Unpacker.UnPackParatextTestProjects();
            m_regData = Unpacker.PrepareRegistryForPTData();

            // TeApp derives from FwApp
            m_testTeApp = new TestTeApp(new string[] {
                "-c", m_sSvrName,                               // ComputerName (aka the SQL server)
                "-proj", m_ProjName,                            // ProjectName
                "-db", m_sDbName
            });                                                 // DatabaseName

            m_fMainWindowOpened = m_testTeApp.OpenMainWindow();

            if (m_fMainWindowOpened)
            {
                m_firstMainWnd = (TestTeMainWnd)m_testTeApp.MainWindows[0];
                // reload the styles from the database (test may have inserted new styles!)
                m_firstMainWnd.Synchronize(new SyncInfo(SyncMsg.ksyncStyle, 0, 0));
                // Set the view to the DraftView
                m_firstMainWnd.SelectScriptureDraftView();
                Application.DoEvents();

                // insert book tests create filters - turn them off to prevent interaction
                // between tests
                m_firstMainWnd.TurnOffAllFilters();

                m_firstDraftView = (TestTeDraftView)m_firstMainWnd.TheDraftView;
                m_firstDraftView.ActivateView();

                SelectionHelper helper = m_firstDraftView.SetInsertionPoint(0, 0, 0, 0, true);
                // helper.IhvoEndPara = -1;
                helper.SetSelection(m_firstDraftView, true, true);

                // we don't want to open a transaction!
            }
        }
예제 #7
0
        public void SelectProjectResetsValues()
        {
            Unpacker.UnpackTEVTitusWithUnmappedStyle();
            RegistryData regData = Unpacker.PrepareRegistryForPTData();

            try
            {
                m_dummyParaDlg.SimulateShowDialog();

                // Edit the suffix and short name in vernacular
                m_dummyParaDlg.SimulateEditingSuffix("abc");
                m_dummyParaDlg.SimulateEditingShortName("bla");

                // Select project from combo box

                // Check that values in dialog get reset to values from Paratext project file
            }
            finally
            {
                regData.RestoreRegistryData();
                Unpacker.RemoveParatextTestProjects();
            }
        }
예제 #8
0
        public void LoadP6ProjectForAnnotationOnlyImportWithOnlyScriptureProjectSet()
        {
            CheckDisposed();

            ScrObjWrapper wrapper  = new ScrObjWrapper();
            ScrImportSet  settings = new ScrImportSet();

            Cache.LangProject.TranslatedScriptureOA.ImportSettingsOC.Add(settings);

            Unpacker.UnPackParatextTestProjects();
            RegistryData regData = Unpacker.PrepareRegistryForPTData();

            try
            {
                settings.ImportTypeEnum        = TypeOfImport.Paratext6;
                settings.ParatextScrProj       = "KAM";
                settings.StartRef              = new BCVRef(1, 1, 1);
                settings.EndRef                = new BCVRef(66, 22, 21);
                settings.ImportAnnotations     = true;
                settings.ImportBackTranslation = false;
                settings.ImportTranslation     = false;
                wrapper.LoadScriptureProject(settings);
                string       sText, sMarker;
                ImportDomain domain;
                Assert.IsTrue(wrapper.GetNextSegment(out sText, out sMarker, out domain));
                Assert.AreEqual(3, wrapper.ExternalPictureFolders.Count);
                Assert.AreEqual(@"C:\~IWTEST~\KAM\Figures", wrapper.ExternalPictureFolders[0]);
            }
            finally
            {
                if (regData != null)
                {
                    regData.RestoreRegistryData();
                }
                Unpacker.RemoveParatextTestProjects();
            }
        }
예제 #9
0
 public void InitFixture()
 {
     Unpacker.UnPackParatextTestProjects();
     m_regData = Unpacker.PrepareRegistryForPTData();
     ScrReferenceTests.InitializeScrReferenceForTests();
 }