Exemple #1
0
 public void Execute(CancellationToken token)
 {
     _attachment.Status = PropertyNames.Processing;
     using (var packager = new MailAttachmentPackager())
     {
         packager.UnPack(_attachment, token);
     }
     _attachment.Status = PropertyNames.IsProcessed;
 }
Exemple #2
0
        // 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);
            }
        }