public void CreateScrNoteCategories() { XmlDocument doc = CreateCategoryXmlDoc(); // Create the annotation categories. DummyTeScrNoteCategoriesInit.CallCreateScrNoteCategories(m_scr, doc); IScrScriptureNote note = Cache.ServiceLocator.GetInstance <IScrScriptureNoteFactory>().Create(); m_scr.BookAnnotationsOS[0].NotesOS.Add(note); // Set the note's category to Discourse-Chiasmus note.CategoriesRS.Add(m_scr.NoteCategoriesOA.PossibilitiesOS[0].SubPossibilitiesOS[0]); // Reload the annotation categories. DummyTeScrNoteCategoriesInit.CallCreateScrNoteCategories(m_scr, doc); // Confirm that the note's category is retained. Assert.AreEqual(m_scr.NoteCategoriesOA.PossibilitiesOS[0].SubPossibilitiesOS[0], note.CategoriesRS[0]); }
public void CreateScrNoteCategories() { CheckDisposed(); XmlDocument doc = CreateCategoryXmlDoc(); // Create the annotation categories. DummyTeScrNoteCategoriesInit.CallCreateScrNoteCategories(m_scr, doc); ScrScriptureNote note = new ScrScriptureNote(); m_scr.BookAnnotationsOS[0].NotesOS.Append(note); // Set the note's category to Discourse-Chiasmus note.CategoriesRS.Append(m_scr.NoteCategoriesOA.PossibilitiesOS[0].SubPossibilitiesOS[0]); // Reload the annotation categories. DummyTeScrNoteCategoriesInit.CallCreateScrNoteCategories(m_scr, doc); // Confirm that the note's category is retained. Assert.AreEqual(m_scr.NoteCategoriesOA.PossibilitiesOS[0].SubPossibilitiesOS[0], note.CategoriesRS[0]); }
public void NestedScrNoteCategoriesInit() { XmlDocument doc = CreateCategoryXmlDoc(); // Create the categories DummyTeScrNoteCategoriesInit.CallCreateScrNoteCategories(m_scr, doc); Assert.AreEqual("Scripture Note Categories", m_scr.NoteCategoriesOA.Name.get_String(Cache.WritingSystemFactory.UserWs).Text); // Make sure there are two top-level categories (possibilities) Assert.AreEqual(2, m_scr.NoteCategoriesOA.PossibilitiesOS.Count); // Look at the contents of the first ScrNoteCategory ICmPossibility scrNoteCategory = m_scr.NoteCategoriesOA.PossibilitiesOS[0]; // Check the name Assert.AreEqual("Discourse", scrNoteCategory.Name.AnalysisDefaultWritingSystem.Text); // Check the abbreviation Assert.AreEqual("D", scrNoteCategory.Abbreviation.AnalysisDefaultWritingSystem.Text); // There should be 2 sub-categories in the catagory Assert.AreEqual(2, scrNoteCategory.SubPossibilitiesOS.Count); // Check the first sub-category ICmPossibility subcategory = scrNoteCategory.SubPossibilitiesOS[0]; Assert.AreEqual("Chiasmus", subcategory.Name.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("D-Chia", subcategory.Abbreviation.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("An arrangement of a series of statements.", subcategory.Description.AnalysisDefaultWritingSystem.Text); // Check the second sub-category subcategory = scrNoteCategory.SubPossibilitiesOS[1]; Assert.AreEqual("Chronological order of events", subcategory.Name.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("D-Chron", subcategory.Abbreviation.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("The sequence of events.", subcategory.Description.AnalysisDefaultWritingSystem.Text); // Look at the contents of the second ScrNoteCategory scrNoteCategory = m_scr.NoteCategoriesOA.PossibilitiesOS[1]; // Check the name Assert.AreEqual("Recourse", scrNoteCategory.Name.AnalysisDefaultWritingSystem.Text); // Check the abbreviation Assert.AreEqual("R", scrNoteCategory.Abbreviation.AnalysisDefaultWritingSystem.Text); // There should be 2 sub-categories in the catagory Assert.AreEqual(2, scrNoteCategory.SubPossibilitiesOS.Count); // Check the first sub-category subcategory = scrNoteCategory.SubPossibilitiesOS[0]; Assert.AreEqual("Chimpanzee", subcategory.Name.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("R-Chimp", subcategory.Abbreviation.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("A derangement of bananas.", subcategory.Description.AnalysisDefaultWritingSystem.Text); // Check the second sub-category subcategory = scrNoteCategory.SubPossibilitiesOS[1]; Assert.AreEqual("Chromophonic odor of events", subcategory.Name.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("R-Chrome", subcategory.Abbreviation.AnalysisDefaultWritingSystem.Text); Assert.AreEqual("The scent of events.", subcategory.Description.AnalysisDefaultWritingSystem.Text); }