private setProjectName ( string name ) : void | ||
name | string | |
return | void |
public void CreateNewLangProject() { const string dbName = "Maileingwij2025"; string storePath = FdoFileHelper.GetWritingSystemDir(Path.Combine(FwDirectoryFinder.ProjectsDirectory, dbName)); string sharedStorePath = DirectoryFinder.GlobalWritingSystemStoreDirectory; using (var dlg = new DummyFwNewLangProject()) { FdoCache cache = null; if (DbExists(dbName)) { DestroyDb(dbName, true); } dlg.setProjectName(dbName); try { dlg.CreateNewLangProj(); Assert.IsTrue(DbExists(dbName)); // despite of the name is DummyProgressDlg no real dialog (doesn't derive from Control), so // we don't need a 'using' cache = FdoCache.CreateCacheFromExistingData( new TestProjectId(FDOBackendProviderType.kXML, DbFilename(dbName)), "en", new DummyFdoUI(), FwDirectoryFinder.FdoDirectories, new FdoSettings(), new DummyProgressDlg()); CheckInitialSetOfPartsOfSpeech(cache); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.AnalysisWritingSystems.Count); Assert.AreEqual("English", cache.ServiceLocator.WritingSystems.AnalysisWritingSystems.First().LanguageName); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.CurrentAnalysisWritingSystems.Count); Assert.AreEqual("English", cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.LanguageName); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.VernacularWritingSystems.Count); Assert.AreEqual("French", cache.ServiceLocator.WritingSystems.VernacularWritingSystems.First().LanguageName); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.CurrentVernacularWritingSystems.Count); Assert.AreEqual("French", cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.LanguageName); } finally { // Blow away the database to clean things up if (cache != null) { cache.Dispose(); } DestroyDb(dbName, false); } } }
public void CreateNewLangProject_NameHasMultipleNonAsciiCharsRemoved() { using (var dlg = new DummyFwNewLangProject()) { const string dbName = "Fra\u014b\u00e7a\u01b4s\u028c"; // get around changing file type if (DbExists(dbName)) DestroyDb(dbName, true); dlg.setProjectName(dbName); try { dlg.SimulatedNonAsciiDialogResult = DialogResult.Cancel; dlg.Show(); Application.DoEvents(); dlg.TestOkButton(); Assert.IsTrue(dlg.NonAsciiWarningWasActivated, "Non-Ascii Project Name should activate the non-Ascii warning."); Assert.AreEqual("Fraas", dlg.ProjectName, "Project Name should have had four non-ASCII characters removed."); } finally { dlg.Close(); // Blow away the database to clean things up DestroyDb(dbName, false); } } }
public void CreateNewLangProject_NameDoesNotHaveNonAsciiCharsRemoved() { using (var dlg = new DummyFwNewLangProject()) { const string dbName = "Fran\u00e7ais"; if (DbExists(dbName)) DestroyDb(dbName, true); dlg.setProjectName(dbName); try { dlg.SimulatedNonAsciiDialogResult = DialogResult.OK; dlg.Show(); Application.DoEvents(); dlg.TestOkButton(); Assert.IsTrue(dlg.NonAsciiWarningWasActivated, "Non-Ascii Project Name should activate the non-Ascii warning."); Assert.AreEqual(dbName, dlg.ProjectName, "Project Name should not have non-ASCII character removed."); } finally { dlg.Close(); // Blow away the database to clean things up DestroyDb(dbName, false); } } }
public void CreateNewLangProject_NameDoesntTriggerNonAsciiWarning() { using (var dlg = new DummyFwNewLangProject()) { const string dbName = "Simple"; if (DbExists(dbName)) DestroyDb(dbName, true); dlg.setProjectName(dbName); try { dlg.Show(); Application.DoEvents(); dlg.TestOkButton(); Assert.IsFalse(dlg.NonAsciiWarningWasActivated, "Ascii-only Project Name should not activate the non-Ascii warning."); } finally { dlg.Close(); // Blow away the database to clean things up DestroyDb(dbName, false); } } }
public void CreateNewLangProject_NameTriggersNonAsciiWarning() { const string dbName = "Fran\u00e7ais"; using (var dlg = new DummyFwNewLangProject()) { dlg.setProjectName(dbName); if (DbExists(dbName)) DestroyDb(dbName, true); try { dlg.Show(); Application.DoEvents(); dlg.TestOkButton(); Assert.IsTrue(dlg.NonAsciiWarningWasActivated, "Project Name should have activated the non-Ascii warning."); } finally { dlg.Close(); // Blow away the database to clean things up DestroyDb(dbName, false); } } }
public void CreateNewLangProject() { const string dbName = "Maileingwij2025"; string storePath = FdoFileHelper.GetWritingSystemDir(Path.Combine(FwDirectoryFinder.ProjectsDirectory, dbName)); string sharedStorePath = DirectoryFinder.GlobalWritingSystemStoreDirectory; using (var dlg = new DummyFwNewLangProject()) { FdoCache cache = null; if (DbExists(dbName)) DestroyDb(dbName, true); dlg.setProjectName(dbName); try { dlg.CreateNewLangProj(); Assert.IsTrue(DbExists(dbName)); // despite of the name is DummyProgressDlg no real dialog (doesn't derive from Control), so // we don't need a 'using' cache = FdoCache.CreateCacheFromExistingData( new TestProjectId(FDOBackendProviderType.kXML, DbFilename(dbName)), "en", new DummyFdoUI(), FwDirectoryFinder.FdoDirectories, new FdoSettings(), new DummyProgressDlg()); CheckInitialSetOfPartsOfSpeech(cache); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.AnalysisWritingSystems.Count); Assert.AreEqual("English", cache.ServiceLocator.WritingSystems.AnalysisWritingSystems.First().LanguageName); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.CurrentAnalysisWritingSystems.Count); Assert.AreEqual("English", cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.LanguageName); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.VernacularWritingSystems.Count); Assert.AreEqual("French", cache.ServiceLocator.WritingSystems.VernacularWritingSystems.First().LanguageName); Assert.AreEqual(1, cache.ServiceLocator.WritingSystems.CurrentVernacularWritingSystems.Count); Assert.AreEqual("French", cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.LanguageName); } finally { // Blow away the database to clean things up if (cache != null) cache.Dispose(); DestroyDb(dbName, false); } } }