Beispiel #1
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();
		}
Beispiel #2
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!
			}
		}
Beispiel #3
0
		public void TestSetup()
		{
			Debug.Assert(m_testTeApp == null, "Why does it have something in m_testTeApp here?");
			Unpacker.UnPackParatextTestProjects();
			m_regData = Unpacker.PrepareRegistryForPTData();
			m_teSubKey = Registry.CurrentUser.CreateSubKey(@"Software\SIL\FieldWorks\Translation Editor");

			// save the width of the style pane, only if it already has a value
			// Tests will fail if the style pane is showing, so we turn it off.
			object keyValue = m_teSubKey.GetValue("DraftStyleAreaWidth");
			if (keyValue != null)
			{
				m_draftAreaStyleWidth = (int)keyValue;
				m_teSubKey.SetValue("DraftStyleAreaWidth", 0);
			}

			// TeApp derives from FwApp
			// Make sure the registry thinks the last time an attempt was made to open TE
			// was successful. Otherwise, the welcome dialog shows up in the middle of tests.
			RegistryBoolSetting successfulStartup = new RegistryBoolSetting(FwSubKey.TE, "OpenSuccessful", true);
			successfulStartup.Value = true;

			// TODO: Figure out what we need to pass into the app
			m_testTeApp = new TestTeApp(new string[0]);

			m_fMainWindowOpened = m_testTeApp.OpenMainWindow();
			Assert.AreEqual(1, m_testTeApp.MainWindows.Count);

			// Sidebar buttons get pressed as part of main window initialization;
			// wait for that initialization to finish before we proceed.
			while (DataUpdateMonitor.IsUpdateInProgress(
				((TestTeMainWnd)m_testTeApp.MainWindows[0]).Cache.MainCacheAccessor))
			{
				Application.DoEvents();
			}

			if (m_fMainWindowOpened)
			{
				m_firstMainWnd = (TestTeMainWnd)m_testTeApp.MainWindows[0];
				m_firstMainWnd.CreateDraftView();
				// Set the view to the DraftView
				m_firstMainWnd.SwitchActiveView(m_firstMainWnd.TheDraftViewWrapper);
				Application.DoEvents();

				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);
				Application.DoEvents();
			}
		}
Beispiel #4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Start up the test application
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void StartTestApp()
		{
			// Make sure the registry thinks the last time an attempt was made to open TE
			// was successful. Otherwise, the welcome dialog shows up in the middle of tests.

			RegistryBoolSetting successfulStartup = new RegistryBoolSetting(FwSubKey.TE, "OpenSuccessful", true);
			successfulStartup.Value = true;

			// TODO-Linux: calling added close method on RegistryBoolSetting
			successfulStartup.Close();

			// TODO: Figure out what to pass into the app
			m_testTeApp = new TestTeApp(new string[0]);

			m_fMainWindowOpened = m_testTeApp.OpenMainWindow();
			Assert.AreEqual(1, m_testTeApp.MainWindows.Count);

			m_DefParaCharsStyle = ResourceHelper.DefaultParaCharsStyleName;

			// Sidebar buttons get pressed as part of main window initialization;
			// wait for that initialization to finish before we proceed.
			while (DataUpdateMonitor.IsUpdateInProgress(
				((TestTeMainWnd)m_testTeApp.MainWindows[0]).Cache.MainCacheAccessor))
			{
				Application.DoEvents();
			}
			((TestTeMainWnd)m_testTeApp.MainWindows[0]).CreateDraftView();
		}
Beispiel #5
0
		public override void FixtureSetup()
		{
			CheckDisposed();
			base.FixtureSetup();

			// 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();
		}
Beispiel #6
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Start up the test application
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void StartTestApp()
		{
			// Make sure the registry thinks the last time an attempt was made to open TE
			// was successful. Otherwise, the welcome dialog shows up in the middle of tests.
			RegistryBoolSetting successfulStartup = new RegistryBoolSetting(FwSubKey.TE, "OpenSuccessful", true);
			successfulStartup.Value = true;

			m_testTeApp = new TestTeApp(new string[] {
														 "-c", m_sSvrName,		// ComputerName (aka the SQL server)
														 "-db", m_sDbName});	// DatabaseName

			m_fMainWindowOpened = m_testTeApp.OpenMainWindow();
			Assert.AreEqual(1, m_testTeApp.MainWindows.Count);

			m_DefParaCharsStyle = FdoResources.DefaultParaCharsStyleName;

			// Sidebar buttons get pressed as part of main window initialization;
			// wait for that initialization to finish before we proceed.
			while (DataUpdateMonitor.IsUpdateInProgress(
				((TestTeMainWnd)m_testTeApp.MainWindows[0]).Cache.MainCacheAccessor))
			{
				Application.DoEvents();
			}
			((TestTeMainWnd)m_testTeApp.MainWindows[0]).CreateDraftView();
		}