コード例 #1
0
            private MemoryStream LoadAttachmentTransform()
            {
                var bytes        = new byte[0];
                var memoryStream = new MemoryStream(bytes);

                _transform = new AttachmentSignatureTransform();
                _transform.LoadInput(memoryStream);

                return(memoryStream);
            }
コード例 #2
0
            public void ThenAttachmentSignatureTransformReturnsExpectedUrl()
            {
                // Arrange
                _transform = new AttachmentSignatureTransform();

                // Act
                string url = _transform.Algorithm;

                // Assert
                const string attachmentSignature =
                    "http://docs.oasis-open.org/wss/oasis-wss-SwAProfile-1.1"
                    + "#Attachment-Content-Signature-Transform";

                Assert.Equal(attachmentSignature, url);
            }
コード例 #3
0
            public void ThenOutputSucceedsWithXmlContentType(string contentType)
            {
                // Arrange
                using (var memoryStream = new MemoryStream())
                {
                    new XmlSerializer(typeof(PayloadInfo)).Serialize(memoryStream, new PayloadInfo());
                    memoryStream.Position = 0;

                    _transform = new AttachmentSignatureTransform(contentType);
                    _transform.LoadInput(memoryStream);

                    // Act
                    var output = _transform.GetOutput(typeof(Stream)) as Stream;

                    // Assert
                    Assert.NotEqual(memoryStream, output);
                }
            }
コード例 #4
0
 public GivenAttachmentSignatureTransformFacts()
 {
     _transform = new AttachmentSignatureTransform();
 }