public void Process_message_if_from_contains_more_than_one_address() { client = TestClient.CreateNaked(session); address = client.Addresses[0]; supplier = TestSupplier.CreateNaked(session); supplier.WaybillSource.EMailFrom = String.Format("edata{0}@msk.katren.ru", supplier.Id); supplier.WaybillSource.SourceType = TestWaybillSourceType.Email; session.Save(supplier); FileHelper.DeleteDir(Settings.Default.DocumentPath); ImapHelper.ClearImapFolder(); var mime = PatchTo(@"..\..\Data\Unparse.eml", String.Format("{0}@waybills.analit.net", address.Id), String.Format("edata{0}@msk.katren.ru,[email protected]", supplier.Id)); ImapHelper.StoreMessage(mime.ToByteData()); Process(); var files = GetFileForAddress(DocType.Waybill); Assert.That(files.Length, Is.EqualTo(1), "не обработали документ"); }
public static void RecreateDirectories() { var dirs = new[] { Settings.Default.BasePath, Settings.Default.ErrorFilesPath, Settings.Default.InboundPath, Settings.Default.TempPath, Settings.Default.HistoryPath, Settings.Default.FTPOptBoxPath, Settings.Default.DownWaybillsPath, Settings.Default.DocumentPath, Settings.Default.CertificatePath, Settings.Default.AttachmentPath }; dirs.Each(d => { if (Directory.Exists(d)) { FileHelper.DeleteDir(d); } Directory.CreateDirectory(d); }); }