Skip to content

Commit

Permalink
fix issue with empty watchlist
Browse files Browse the repository at this point in the history
  • Loading branch information
NovichikhinAlexey committed Jan 21, 2021
1 parent 0cb0360 commit 2740b3d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ async Task<List<string>> IAvailableAssetClient.GetAssetIds(string clientId, bool

private WatchListDto FromWatchListResponse(WatchList item)
{
if (item == null)
return null;


return new WatchListDto()
{
Id = item.Id,
Expand All @@ -146,6 +150,9 @@ private WatchListDto FromWatchListResponse(WatchList item)

private WatchList FromWatchListDto(WatchListDto item)
{
if (item == null)
return null;

return new WatchList(item.AssetIds, item.Id, item.Name, item.Order, item.ReadOnly);
}

Expand Down
14 changes: 14 additions & 0 deletions tests/Lykke.Service.Assets.Tests.ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Threading;
using Antares.Service.Assets.Client;
using Common;
using Lykke.Service.Assets.Client;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
Expand Down Expand Up @@ -56,6 +57,19 @@ static void Main(string[] args)
Console.WriteLine();
var assetPairs = client.AssetPairs.GetAll();
Console.WriteLine($"Asset pairs count: {assetPairs.Count}");

var clientUsder = new AssetsServiceUserDataClient("nosql.share.svc.cluster.local:5125",
"http://assets.lykke-service.svc.cluster.local");
clientUsder.Start();

var wl = clientUsder.WatchLists
.GetCustomWatchListAsync("fcf49f02-f230-4179-82b6-4d876b0402f9", "f1769fc8-ca6d-4025-a842-515af74e2f6e")
.GetAwaiter()
.GetResult();

Console.WriteLine($"Watch list: {wl?.ToJson()}");

//GetCustomWatchListAsync
}
}
}

0 comments on commit 2740b3d

Please sign in to comment.