From 7b17d7f7762749bd9f4ce3715b0f3f5fce60fb6a Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Tue, 25 May 2021 09:40:20 +0200 Subject: [PATCH] staclink tests --- src/DotNetStac.Test/StacLink/StacLinkTests.cs | 27 +++++++++++++++++++ src/DotNetStac/StacLink.cs | 6 ----- 2 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 src/DotNetStac.Test/StacLink/StacLinkTests.cs diff --git a/src/DotNetStac.Test/StacLink/StacLinkTests.cs b/src/DotNetStac.Test/StacLink/StacLinkTests.cs new file mode 100644 index 00000000..30da7ad3 --- /dev/null +++ b/src/DotNetStac.Test/StacLink/StacLinkTests.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using GeoJSON.Net; +using GeoJSON.Net.Geometry; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Stac.Test.Item +{ + public class StacLinkTests : TestBase + { + [Fact] + public void CreateHelpers() + { + StacLink.CreateDerivedFromLink(new Uri("file:///test")); + StacLink.CreateAlternateLink(new Uri("file:///test")); + StacLink.CreateChildLink(new Uri("file:///test")); + var stacLink = StacLink.CreateItemLink(new Uri("file:///test"), "text/plain"); + stacLink.Title = "test"; + var cloned = new StacLink(stacLink); + Assert.Equal(stacLink, cloned); + cloned = stacLink.Clone(); + Assert.Equal(stacLink, cloned); + } + } +} diff --git a/src/DotNetStac/StacLink.cs b/src/DotNetStac/StacLink.cs index 1d476315..ef2df255 100644 --- a/src/DotNetStac/StacLink.cs +++ b/src/DotNetStac/StacLink.cs @@ -68,12 +68,6 @@ public StacLink(Uri uri) Uri = uri; } - public StacLink(Uri uri, IStacObject hostObject) - { - this.Uri = uri; - this.Parent = hostObject; - } - public StacLink(Uri uri, string relationshipType, string title, string mediaType, ulong contentLength = 0) { Uri = uri;