コード例 #1
0
		public void ScanOutOfOrderChapterFile()
		{
			string fileContents = "\\id MAT\r\n\\c 4\r\n\\c 3\r\n\\c 2\r\n\\c 1";
			DummyScrImportFileInfo info = new DummyScrImportFileInfo(fileContents,
				m_mappingList, false);

			ReferenceRange[] range = info.BookReferences;
			Assert.IsNotNull(range, "No reference range was created");
			Assert.AreEqual(1, range.Length);
			Assert.AreEqual(40, range[0].Book);
			Assert.AreEqual(4, range[0].StartChapter);
			Assert.AreEqual(1, range[0].EndChapter);
		}
コード例 #2
0
		public void ScanNoChapterFile()
		{
			string fileContents = "\\id PHM\r\n\blah haha - no chapters!";
			DummyScrImportFileInfo info = new DummyScrImportFileInfo(fileContents,
				m_mappingList, false);

			ReferenceRange[] range = info.BookReferences;
			Assert.IsNotNull(range, "No reference range was created");
			Assert.AreEqual(1, range.Length);
			Assert.AreEqual(57, range[0].Book);
			Assert.AreEqual(1, range[0].StartChapter);
			Assert.AreEqual(1, range[0].EndChapter);
		}
コード例 #3
0
		public void ScanMultiBookFile()
		{
			string fileContents = "\\id MAT\r\n\\c 12\r\n\\c 25\r\n\\c 34\r\n\\id REV\r\n\\c 1\r\n\\c 2";
			DummyScrImportFileInfo info = new DummyScrImportFileInfo(fileContents,
				m_mappingList, false);

			ReferenceRange[] range = info.BookReferences;
			Assert.IsNotNull(range, "No reference range was created");
			Assert.AreEqual(2, range.Length);

			Assert.AreEqual(40, range[0].Book);
			Assert.AreEqual(12, range[0].StartChapter);
			Assert.AreEqual(34, range[0].EndChapter);

			Assert.AreEqual(66, range[1].Book);
			Assert.AreEqual(1, range[1].StartChapter);
			Assert.AreEqual(2, range[1].EndChapter);
		}