public void CreateLargePackage() { using (var package = new SimplePackage()) { DirectoryInfo repository = new DirectoryInfo(LocalRepository.CalculateRepositoryPath(Log.SessionSummary.Product)); FileInfo[] allExistingFileFragments = repository.GetFiles("*." + Log.LogExtension, SearchOption.TopDirectoryOnly); foreach (var fileFragment in allExistingFileFragments) { var sourceFile = FileHelper.OpenFileStream(fileFragment.FullName, FileMode.Open, FileAccess.ReadWrite, FileShare.Read); if (sourceFile != null) { package.AddSession(sourceFile); } } using (ProgressMonitorStack stack = new ProgressMonitorStack("saving Package")) { package.Save(stack, m_OutputFileNamePath); } } Assert.IsTrue(File.Exists(m_OutputFileNamePath), "Packge was not created"); Assert.Greater(new FileInfo(m_OutputFileNamePath).Length, 100, "The package was likely empty but should have contained multiple sessions."); File.Delete(m_OutputFileNamePath); }
public void CreateEmptyPackage() { using (var package = new SimplePackage()) { using (ProgressMonitorStack stack = new ProgressMonitorStack("saving Package")) { package.Save(stack, m_OutputFileNamePath); } } Assert.IsTrue(File.Exists(m_OutputFileNamePath), "Package was not created"); File.Delete(m_OutputFileNamePath); }