Exemplo n.º 1
0
        public void GivenAClient_WhenGettingDocumentMetadata()
        {
            _expected = SetupExpectedDocumentMetadata();
            var requestUri             = new Uri($"https://document-api.companieshouse.gov.uk/document/{DocumentId}");
            var stubHttpMessageHandler = SetupApiResponse(_expected, requestUri);
            var mockUriBuilder         = SetupRequestUri(requestUri);

            _result = new CompaniesHouseDocumentMetadataClient(new HttpClient(stubHttpMessageHandler), mockUriBuilder.Object)
                      .GetDocumentMetadataAsync(DocumentId).Result;
        }
Exemplo n.º 2
0
        private static StubHttpMessageHandler SetupApiResponse(DocumentMetadataTestCase expected, Uri catchUri)
        {
            var resource = new DocumentMetadataResourceBuilder(expected).Create();

            return(new StubHttpMessageHandler(catchUri, resource));
        }
 public DocumentMetadataResourceBuilder(DocumentMetadataTestCase documentMetadataTestCase)
 {
     _documentMetadataTestCase = documentMetadataTestCase;
 }