public void SetBookNameAbbrev() { CheckDisposed(); CreateTestData(); m_phm = m_scr.ScriptureBooksOS[0]; m_phmBkRef = Cache.ScriptureReferenceSystem.BooksOS[m_phm.CanonicalNum - 1]; // Set up the analysis writing system in ScrBook and the analysis writing system in ScrBookRef. m_phm.Name.SetAlternative("Foilemon", m_inMemoryCache.Cache.DefaultAnalWs); m_phm.Abbrev.SetAlternative("Foil", m_inMemoryCache.Cache.DefaultAnalWs); m_phmBkRef.BookName.SetAlternative("Filemon", m_inMemoryCache.Cache.DefaultVernWs); m_phmBkRef.BookAbbrev.SetAlternative("Fil", m_inMemoryCache.Cache.DefaultVernWs); // Updating the name and abbreviation with the Book Properties dialog should set the // information from the ScrRefSystem in both ScrBook and ScrBookRef. using (DummyBookPropertiesDlg dlg = new DummyBookPropertiesDlg(m_phm, m_stylesheet)) { dlg.Show(); System.Threading.Thread.Sleep(1000); dlg.CallUpdateBookProperties(); // We expect that the ScrBook and ScrBookRef will be set to the same values. // The BookPropertiesDialog should get the settings from the ScrBook, and if they are // not set there (as is the case with the vernacular), look in ScrBookRef. Assert.AreEqual("Filemon", m_phm.Name.VernacularDefaultWritingSystem); Assert.AreEqual("Filemon", m_phmBkRef.BookName.VernacularDefaultWritingSystem); Assert.AreEqual("Fil", m_phm.Abbrev.VernacularDefaultWritingSystem); Assert.AreEqual("Fil", m_phmBkRef.BookAbbrev.VernacularDefaultWritingSystem); Assert.AreEqual("Foilemon", m_phm.Name.AnalysisDefaultWritingSystem); Assert.AreEqual("Foilemon", m_phmBkRef.BookName.AnalysisDefaultWritingSystem); Assert.AreEqual("Foil", m_phm.Abbrev.AnalysisDefaultWritingSystem); Assert.AreEqual("Foil", m_phmBkRef.BookAbbrev.AnalysisDefaultWritingSystem); dlg.Close(); } //dlg.Dispose(); }
public void SetBookNameAbbrev() { m_phm = m_scr.ScriptureBooksOS[0]; IScrRefSystem scrRefSystem = Cache.ServiceLocator.GetInstance <IScrRefSystemRepository>().AllInstances().FirstOrDefault(); m_phmBkRef = scrRefSystem.BooksOS[m_phm.CanonicalNum - 1]; // Set up the analysis writing system in ScrBook and the analysis writing system in ScrBookRef. m_phm.Name.set_String(Cache.DefaultVernWs, string.Empty); m_phm.Name.set_String(Cache.DefaultAnalWs, "Foilemon"); m_phm.Abbrev.set_String(Cache.DefaultAnalWs, "Foil"); m_phmBkRef.BookName.set_String(Cache.DefaultVernWs, "Filemon"); m_phmBkRef.BookAbbrev.set_String(Cache.DefaultVernWs, "Fil"); // Updating the name and abbreviation with the Book Properties dialog should set the // information from the ScrRefSystem in both ScrBook and ScrBookRef. using (DummyBookPropertiesDlg dlg = new DummyBookPropertiesDlg(m_phm, m_stylesheet)) { dlg.Show(); dlg.CallUpdateBookProperties(); // We expect that the ScrBook and ScrBookRef will be set to the same values. // The BookPropertiesDialog should get the settings from the ScrBook, and if they are // not set there (as is the case with the vernacular), look in ScrBookRef. Assert.AreEqual("Filemon", m_phm.Name.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Filemon", m_phmBkRef.BookName.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Fil", m_phm.Abbrev.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Fil", m_phmBkRef.BookAbbrev.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Foilemon", m_phm.Name.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("Foilemon", m_phmBkRef.BookName.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("Foil", m_phm.Abbrev.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("Foil", m_phmBkRef.BookAbbrev.AnalysisDefaultWritingSystem.Text); dlg.Close(); } //dlg.Dispose(); }
public void SetBookNameAbbrev() { m_phm = m_scr.ScriptureBooksOS[0]; IScrRefSystem scrRefSystem = Cache.ServiceLocator.GetInstance<IScrRefSystemRepository>().AllInstances().FirstOrDefault(); m_phmBkRef = scrRefSystem.BooksOS[m_phm.CanonicalNum - 1]; // Set up the analysis writing system in ScrBook and the analysis writing system in ScrBookRef. m_phm.Name.set_String(Cache.DefaultVernWs, string.Empty); m_phm.Name.set_String(Cache.DefaultAnalWs, "Foilemon"); m_phm.Abbrev.set_String(Cache.DefaultAnalWs, "Foil"); m_phmBkRef.BookName.set_String(Cache.DefaultVernWs, "Filemon"); m_phmBkRef.BookAbbrev.set_String(Cache.DefaultVernWs, "Fil"); // Updating the name and abbreviation with the Book Properties dialog should set the // information from the ScrRefSystem in both ScrBook and ScrBookRef. using (DummyBookPropertiesDlg dlg = new DummyBookPropertiesDlg(m_phm, m_stylesheet)) { dlg.Show(); dlg.CallUpdateBookProperties(); // We expect that the ScrBook and ScrBookRef will be set to the same values. // The BookPropertiesDialog should get the settings from the ScrBook, and if they are // not set there (as is the case with the vernacular), look in ScrBookRef. Assert.AreEqual("Filemon", m_phm.Name.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Filemon", m_phmBkRef.BookName.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Fil", m_phm.Abbrev.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Fil", m_phmBkRef.BookAbbrev.VernacularDefaultWritingSystem.Text); Assert.AreEqual("Foilemon", m_phm.Name.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("Foilemon", m_phmBkRef.BookName.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("Foil", m_phm.Abbrev.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("Foil", m_phmBkRef.BookAbbrev.AnalysisDefaultWritingSystem.Text); dlg.Close(); } //dlg.Dispose(); }