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); } } }