Ejemplo n.º 1
0
 /// <summary>
 /// Check <see cref="IAssetService"/> for more information
 /// </summary>
 /// <param name="query">Check <see cref="IAssetService"/> for more information</param>
 /// <returns>Check <see cref="IAssetService"/> for more information</returns>
 public async Task <IList <String> > GetMetapropertyDependenciesAsync(MetapropertyQuery query)
 {
     return(await _requestSender.SendRequestAsync(new ApiRequest <IList <string> >
     {
         Path = $"api/v4/metaproperties/{query.MetapropertyId}/dependencies/",
         HTTPMethod = HttpMethod.Get
     }).ConfigureAwait(false));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Check <see cref="IAssetService"/> for more information
 /// </summary>
 /// <param name="query">Check <see cref="IAssetService"/> for more information</param>
 /// <returns>Check <see cref="IAssetService"/> for more information</returns>
 public async Task <Metaproperty> GetMetapropertyAsync(MetapropertyQuery query)
 {
     return(await _requestSender.SendRequestAsync(new ApiRequest <Metaproperty>
     {
         Path = $"/api/v4/metaproperties/{query.MetapropertyId}",
         HTTPMethod = HttpMethod.Get
     }).ConfigureAwait(false));
 }
        public async Task GetMetapropertyDependenciesCallsRequestSenderWithValidRequest()
        {
            var result = new List <string>();

            _apiRequestSenderMock.Setup(sender => sender.SendRequestAsync(It.IsAny <ApiRequest <IList <string> > >()))
            .ReturnsAsync(result);
            var query        = new MetapropertyQuery("metapropertyId");
            var dependencies = await _assetService.GetMetapropertyDependenciesAsync(query);

            _apiRequestSenderMock.Verify(sender => sender.SendRequestAsync(
                                             It.Is <ApiRequest <IList <string> > >(req =>
                                                                                   req.Path == $"api/v4/metaproperties/{query.MetapropertyId}/dependencies/" &&
                                                                                   req.HTTPMethod == HttpMethod.Get &&
                                                                                   req.Query == null
                                                                                   )
                                             ));

            Assert.Equal(result, dependencies);
        }