Пример #1
0
        private async Task ShouldGetFileDetails()
        {
            const string fileId     = "file_1351861";
            var          idResponse = new FileDetailsResponse();

            _apiClient.Setup(apiClient =>
                             apiClient.Get <FileDetailsResponse>($"files/{fileId}", _authorization, CancellationToken.None))
            .ReturnsAsync(() => idResponse);

            IFilesClient client = new FilesClient(_apiClient.Object, null, _configuration.Object);

            var response = await client.GetFileDetails(fileId);

            response.ShouldNotBeNull();
        }
Пример #2
0
        private async Task ShouldSubmitFile()
        {
            const string filePath   = "./Resources/checkout.jpeg";
            var          idResponse = new IdResponse();

            _apiClient.Setup(apiClient =>
                             apiClient.Post <IdResponse>(
                                 "files",
                                 _authorization,
                                 It.IsAny <MultipartFormDataContent>(),
                                 CancellationToken.None,
                                 null))
            .ReturnsAsync(() => idResponse);

            IFilesClient client = new FilesClient(_apiClient.Object, null, _configuration.Object);

            var response = await client.SubmitFile(filePath, "dispute_evidence");

            response.ShouldNotBeNull();
        }