public void Execute(CancellationToken token) { _attachment.Status = PropertyNames.Processing; using (var packager = new MailAttachmentPackager()) { packager.UnPack(_attachment, token); } _attachment.Status = PropertyNames.IsProcessed; }
// ReSharper disable once UnusedParameter.Local private void VerifyFilesAreOfType(IProtectAttachment attachment, FileType fileType) { using (var packager = new MailAttachmentPackager()) { packager.UnPack(attachment, new CancellationToken()); } var flattenedList = TestUtils.Flatten(attachment.Children, new List<FileType>() { FileType.Email }); foreach (var item in flattenedList) { Assert.IsTrue(item.FileType == fileType); } }