public void CollectionStacObjectLink() { var simpleJson = GetJson("Collection", "CanDeserializeSentinel2Sample"); ValidateJson(simpleJson); StacCollection simpleCollection = StacConvert.Deserialize <StacCollection>(simpleJson); StacObjectLink stacObjectLink = (StacObjectLink)StacLink.CreateObjectLink(simpleCollection, new Uri("file:///test")); }
public void CatalogStacObjectLink() { var simpleJson = GetJson("Catalog", "CanDeserializeMinimalSample"); ValidateJson(simpleJson); StacCatalog simpleCollection = StacConvert.Deserialize <StacCatalog>(simpleJson); StacObjectLink stacObjectLink = (StacObjectLink)StacLink.CreateObjectLink(simpleCollection, new Uri("file:///test")); }
public void StacObjectLink() { var simpleJson = GetJson("Exceptions", "MinimalSample"); ValidateJson(simpleJson); StacItem simpleitem = StacConvert.Deserialize <StacItem>(simpleJson); StacObjectLink stacObjectLink = (StacObjectLink)StacLink.CreateObjectLink(simpleitem, new Uri("file:///test")); Assert.Throws <InvalidOperationException>(() => stacObjectLink.Title = "test"); Assert.Throws <InvalidOperationException>(() => stacObjectLink.ContentType = new System.Net.Mime.ContentType("text/plain")); Assert.Equal(simpleitem, stacObjectLink.StacObject); StacLink nullStacLink = null; Assert.Throws <ArgumentNullException>(() => new StacLink(nullStacLink)); }