示例#1
0
        public async Task CreateAssetUsageCallsRequestSenderWithValidRequest()
        {
            var result = new Status {
                Message = "Accepted", StatusCode = 200
            };

            _apiRequestSenderMock.Setup(sender => sender.SendRequestAsync(It.IsAny <ApiRequest>()))
            .ReturnsAsync(result);
            var query = new AssetUsageQuery("integrationId", "assetId");
            await _assetService.CreateAssetUsage(query);

            _apiRequestSenderMock.Verify(sender => sender.SendRequestAsync(
                                             It.Is <ApiRequest>(req =>
                                                                req.Path == $"/api/media/usage/" &&
                                                                req.HTTPMethod == HttpMethod.Post &&
                                                                req.Query == query
                                                                )
                                             ));
        }