Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Apr 1, 2021
1 parent 8acb392 commit 87b701a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 44 deletions.
19 changes: 19 additions & 0 deletions src/DotNetStac.Test/Schemas/SchemaLoaderTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Stac.Extensions.Sat;
using Newtonsoft.Json;
using Xunit;
using Stac.Extensions;
using Stac.Exceptions;

namespace Stac.Test.Item
{
public class SchemaLoaderTests : TestBase
{
[Fact]
public void ThrowInvalidExtensionShortcut()
{
Assert.Throws<InvalidStacSchemaException>(() => SchemaBasedStacExtension.Create("item", null, null));

}

}
}
2 changes: 0 additions & 2 deletions src/DotNetStac/Collection/IStacSummaryItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace Stac.Collection
{
public interface IStacSummaryItem : IEnumerable<JToken>
{
SummaryItemType SummaryType { get; }

JToken this[object key] { get; }

JToken AsJToken { get; }
Expand Down
2 changes: 0 additions & 2 deletions src/DotNetStac/Collection/StacSummaryItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public JToken this[object key]
}
}

public abstract SummaryItemType SummaryType { get; }

public JToken AsJToken => summary;

public IEnumerator GetEnumerator()
Expand Down
4 changes: 1 addition & 3 deletions src/DotNetStac/Collection/StacSummaryStatsObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class StacSummaryStatsObject<T> : StacSummaryItem
public StacSummaryStatsObject(JObject summary) : base(summary)
{
if (!summary.ContainsKey("minimum") || !summary.ContainsKey("maximum"))
throw new ArgumentException("summary stats must contains min and max");
throw new ArgumentException("summary stats must contains minimum and maximum fields");
}

public StacSummaryStatsObject(T min, T max) : base(new JObject())
Expand All @@ -24,8 +24,6 @@ public StacSummaryStatsObject(T min, T max) : base(new JObject())

public T Max { get => summary["maximum"].Value<T>(); set => summary["maximum"] = new JValue(value); }

public override SummaryItemType SummaryType => SummaryItemType.StatsObject;


}
}
2 changes: 0 additions & 2 deletions src/DotNetStac/Collection/StacSummaryValueSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public void Add(T item){
((JArray)summary).Add(item);
}

public override SummaryItemType SummaryType => SummaryItemType.ValueSet;

public int Count => summary.Count();

public IEnumerable<T> SummarySet { get => summary.ToObject<List<T>>(); }
Expand Down
34 changes: 0 additions & 34 deletions src/DotNetStac/Exceptions/ExtensionNotAssignedException.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/DotNetStac/Exceptions/InvalidStacSchemaException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Stac.Exceptions
{
[Serializable]
internal class InvalidStacSchemaException : Exception
public class InvalidStacSchemaException : Exception
{
public InvalidStacSchemaException()
{
Expand Down

0 comments on commit 87b701a

Please sign in to comment.