public async Task <ResultWrapper <DataAssetInfoForRpc[]> > ndm_getKnownDataAssets()
        {
            IReadOnlyList <DataAssetInfo> dataAssets = await _consumerService.GetKnownDataAssetsAsync();

            return(ResultWrapper <DataAssetInfoForRpc[]> .Success(dataAssets
                                                                  .Select(d => new DataAssetInfoForRpc(d)).ToArray()));
        }
Exemplo n.º 2
0
        public async Task get_known_data_assets_should_return_data_asset_info()
        {
            _consumerService.GetKnownDataAssetsAsync()
            .Returns(new[] { new DataAssetInfo(Keccak.Zero, "test", "test") });
            var result = await _rpc.ndm_getKnownDataAssets();

            await _consumerService.Received().GetKnownDataAssetsAsync();

            result.Data.Should().ContainSingle();
            var dataAsset = result.Data.Single();

            dataAsset.Id.Should().Be(Keccak.Zero);
            dataAsset.Name.Should().Be("test");
            dataAsset.Description.Should().Be("test");
        }