Skip to content

Commit

Permalink
limit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Sep 9, 2020
1 parent b96dd3d commit 633493c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/DotNetStac.Test/Examples/Example1Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ public void Deserialize()

}

public static void ListChildrensItemsAndAssets(IStacCatalog catalog, string prefix = "")
public static void ListChildrensItemsAndAssets(IStacCatalog catalog, string prefix = "", int limit = 2)
{
foreach (var child in catalog.GetChildren().Values)
// Get children first (sub catalogs and collections)
foreach (var child in catalog.GetChildren().Values.Take(limit))
{
Console.Out.WriteLine(prefix + child.Id);
Console.Out.WriteLine(prefix + child.Id + ": " + child.Description);

foreach (var item in child.GetItems().Values)
foreach (var item in child.GetItems().Values.Take(limit))
{
Console.Out.WriteLine(prefix + " " + item.Id);
foreach (var asset in item.Assets.Values)
{
Console.Out.WriteLine(prefix + " *" + asset.Uri);
Console.Out.WriteLine(prefix + " *[" + asset.MediaType + "] " + asset.Uri);
}
}

Expand Down

0 comments on commit 633493c

Please sign in to comment.