예제 #1
0
		public void Add_NonExistantFile()
		{
			DummyScrImportFileInfoFactory factory = new DummyScrImportFileInfoFactory();

			IScrImportFileInfo f1 = CreateStubFileInfo(factory, "file1",
				new ScrReference(40, 1, 1, ScrVers.English), new ReferenceRange(40, 1,3));

			IScrImportFileInfo f2 = factory.Create("IdontExist.blurb", m_mappingList,
				ImportDomain.Main, null, null, false);
			f2.Stub(x => x.IsReadable).Return(false);

			m_fileList.Add(f1);
			m_fileList.Add(f2);

			Assert.AreEqual(2, m_fileList.Count);
			Assert.AreEqual(f1, m_fileList[0]);
			Assert.AreEqual(f2, m_fileList[1]);
			m_resolver.VerifyAllExpectations();
			Assert.AreEqual(0, m_callCountForVerifyFileRemoved);
		}
예제 #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Test CheckForOverlaps where the user elects to keep file 1 in the Overlapping Files
		/// dialog
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private IScrImportFileInfo CreateStubFileInfo(DummyScrImportFileInfoFactory factory,
			string name, ScrReference startRef, ReferenceRange refRange)
		{
			IScrImportFileInfo f = factory.Create(name, m_mappingList, ImportDomain.Main,
						null, null, false);

			f.Stub(x => x.IsReadable).Return(true);
			f.Stub(x => x.IsStillReadable).Return(true);
			f.Stub(x => x.StartRef).Return(startRef);
			f.Stub(x => x.BookReferences).Return(new ReferenceRange[] { refRange });

			return f;
		}