-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98d56bd
commit adffa00
Showing
39 changed files
with
535 additions
and
1,281 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/DotNetStac.Test/Collection/StacRepositoryCollectionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using Xunit; | ||
|
||
namespace Stac.Test.Catalog | ||
{ | ||
public class StacRepositoryCollectionTests : TestBase | ||
{ | ||
private readonly string currentVersion; | ||
|
||
public StacRepositoryCollectionTests(){ | ||
var packageJson = httpClient.GetStringAsync("https://raw.githubusercontent.com/radiantearth/stac-spec/master/package.json").GetAwaiter().GetResult(); | ||
JObject package = JsonConvert.DeserializeObject<JObject>(packageJson); | ||
currentVersion = package.Value<string>("version"); | ||
} | ||
|
||
[Fact] | ||
public void CanDeserializeBaseCollectionExample() | ||
{ | ||
var json = httpClient.GetStringAsync("https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/collection.json").GetAwaiter().GetResult(); | ||
|
||
ValidateJson(json); | ||
|
||
StacCollection collection = StacConvert.Deserialize<StacCollection>(json); | ||
|
||
Assert.NotNull(collection); | ||
|
||
Assert.Equal(currentVersion, collection.StacVersion.ToString()); | ||
|
||
string collection2json = StacConvert.Serialize(collection); | ||
|
||
ValidateJson(collection2json); | ||
|
||
JsonAssert.AreEqual(json, collection2json); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.