Exemple #1
0
            public async Task Accepts_request_with_xml_in_multipart()
            {
                //Arrange
                var client = GetClientWithRequestValidator(new FakeHttpClientForDataResponse());
                var validRequestContent = new FakeHttpClientHandlerForMultipartXml(ContentUtility.GetDirectSignatureJobRequestBody()).GetContent();

                //Act
                await client.SendAsync(GetHttpRequestMessage(validRequestContent)).ConfigureAwait(false);

                //Assert
            }
Exemple #2
0
            public async Task Throws_exception_on_invalid_manifest_in_attachment()
            {
                //Arrange
                var client = GetClientWithRequestValidator(new FakeHttpClientForDataResponse());

                var serializedfunc = new Func <IRequestContent, string>(p => ContentUtility.GetDirectSignatureJobRequestBody());

                var manifestBytes = Encoding.UTF8.GetBytes(XmlResource.Request.GetPortalManifest().OuterXml);
                var asiceArchive  = new AsiceArchive(new List <AsiceAttachableProcessor>());

                asiceArchive.AddAttachable("manifest.xml", manifestBytes);
                var documentBundle = new DocumentBundle(asiceArchive.GetBytes());

                var createAction = new CreateAction(new FakeJob(), documentBundle, serializedfunc);

                //Act
                await Assert.ThrowsAsync <InvalidXmlException>(async() => await client.SendAsync(GetHttpRequestMessage(createAction.Content())).ConfigureAwait(false)).ConfigureAwait(false);

                //Assert
            }