Esempio n. 1
0
        public void VerifyTeStyleNames()
        {
            CheckDisposed();

            string[] ptStyle = new string[] { "id", "h", "io2", "ip", "c", "v", "p", "q", "mt", "th3", "fv" };
            string[] teStyle = new string[] {
                "Book ID",
                ImportWizard.s_sTitleShortStyle,
                "Intro List Item2",
                "Intro Paragraph",
                "Chapter Number",
                "Verse Number",
                "Paragraph",
                "Citation Line1",
                "Title Main",
                "Table Cell Head",
                "Verse Number In Note"
            };
            SCScriptureTextClass scText = new SCScriptureTextClass();

            scText.Load("TEV");
            SCTagClass scTag;

            for (int i = 0; i < ptStyle.Length; i++)
            {
                int tagIndex = scText.TagIndex(ptStyle[i]);
                scTag = (SCTagClass)scText.NthTag(tagIndex);
                Assert.IsNotNull(scTag);
                Debug.WriteLine(i.ToString() + " - " + scTag.TeStyleName);
                Assert.AreEqual(teStyle[i], scTag.TeStyleName);
            }
        }
Esempio n. 2
0
        public void GetStyleTags()
        {
            CheckDisposed();

            SCScriptureTextClass scText = new SCScriptureTextClass();

            scText.Load("TEV");
            SCTagClass scTag;

            string endMarker  = "";
            int    iEndMarker = 0;
            int    i;

            for (i = 0; scText.NthTag(i) != null; i++)
            {
                scTag = (SCTagClass)scText.NthTag(i);
                // Usefull when the USFM.sty is changed and the marker positions are changed
                // Debug.WriteLine(i + "\t\t" + scTag.Marker + "\t\t" + scTag.Endmarker);
                switch (i)
                {
                case 0:
                    Assert.AreEqual("id", scTag.Marker);
                    Assert.AreEqual("", scTag.Endmarker);
                    break;

                case 19:
                    Assert.AreEqual("io2", scTag.Marker);
                    Assert.AreEqual("", scTag.Endmarker);
                    break;

                case 171:
                    Assert.AreEqual("nd", scTag.Marker);
                    Assert.AreEqual("nd*", scTag.Endmarker);
                    break;

                case 172:
                    Assert.AreEqual("nd*", scTag.Marker);
                    Assert.AreEqual("", scTag.Endmarker);
                    break;

                default:
                    break;
                }

                // if we got an end marker we expect the next marker to be the end marker
                if (endMarker != string.Empty)
                {
                    Assert.AreEqual(endMarker, scTag.Marker);
                    Assert.AreEqual(iEndMarker + 1, i);
                    endMarker  = "";
                    iEndMarker = 0;
                }

                // if we have an endmarker, remember that for comparison with next marker
                if (scTag.Endmarker != string.Empty)
                {
                    endMarker  = scTag.Endmarker;
                    iEndMarker = i;
                }
            }

            // our TEV project has 158 markers and 43 endmarkers (which count separately).
            Assert.AreEqual(201, i);
        }
Esempio n. 3
0
		public void GetStyleTags()
		{
			CheckDisposed();

			SCScriptureTextClass scText = new SCScriptureTextClass();

			scText.Load("TEV");
			SCTagClass scTag;

			string endMarker = "";
			int iEndMarker = 0;
			int i;

			for(i = 0; scText.NthTag(i) != null; i++)
			{
				scTag = (SCTagClass)scText.NthTag(i);
				// Usefull when the USFM.sty is changed and the marker positions are changed
				// Debug.WriteLine(i + "\t\t" + scTag.Marker + "\t\t" + scTag.Endmarker);
				switch(i)
				{
					case 0:
						Assert.AreEqual("id", scTag.Marker);
						Assert.AreEqual("", scTag.Endmarker);
						break;
					case 19:
						Assert.AreEqual("io2", scTag.Marker);
						Assert.AreEqual("", scTag.Endmarker);
						break;
					case 171:
						Assert.AreEqual("nd", scTag.Marker);
						Assert.AreEqual("nd*", scTag.Endmarker);
						break;
					case 172:
						Assert.AreEqual("nd*", scTag.Marker);
						Assert.AreEqual("", scTag.Endmarker);
						break;
					default:
						break;
				}

				// if we got an end marker we expect the next marker to be the end marker
				if (endMarker != string.Empty)
				{
					Assert.AreEqual(endMarker, scTag.Marker);
					Assert.AreEqual(iEndMarker + 1, i);
					endMarker = "";
					iEndMarker = 0;
				}

				// if we have an endmarker, remember that for comparison with next marker
				if (scTag.Endmarker != string.Empty)
				{
					endMarker = scTag.Endmarker;
					iEndMarker = i;
				}
			}

			// our TEV project has 158 markers and 43 endmarkers (which count separately).
			Assert.AreEqual(201, i);
		}
Esempio n. 4
0
		public void VerifyTeStyleNames()
		{
			CheckDisposed();

			string[] ptStyle = new string[] {"id", "h", "io2", "ip", "c", "v", "p", "q", "mt", "th3", "fv"};
			string[] teStyle = new string[] {
				"Book ID",
				ImportWizard.s_sTitleShortStyle,
				"Intro List Item2",
				"Intro Paragraph",
				"Chapter Number",
				"Verse Number",
				"Paragraph",
				"Citation Line1",
				"Title Main",
				"Table Cell Head",
				"Verse Number In Note"
											  };
			SCScriptureTextClass scText = new SCScriptureTextClass();

			scText.Load("TEV");
			SCTagClass scTag;

			for (int i = 0; i < ptStyle.Length; i++)
			{
				int tagIndex = scText.TagIndex(ptStyle[i]);
				scTag = (SCTagClass)scText.NthTag(tagIndex);
				Assert.IsNotNull(scTag);
				Debug.WriteLine(i.ToString() + " - " + scTag.TeStyleName);
				Assert.AreEqual(teStyle[i], scTag.TeStyleName);
			}
		}