diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8df7bae..bf71686c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,9 +19,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 3.1.x - 5.0.x + dotnet-version: '8.0.x' - name: Install dependencies run: dotnet restore src/GeoJSON.Net.sln - name: Build @@ -38,9 +36,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 3.1.x - 5.0.x + dotnet-version: '8.0.x' - name: Install dependencies run: dotnet restore src/GeoJSON.Net.sln - name: Build diff --git a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/DefaultCrsTests.cs b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/DefaultCrsTests.cs index 0cd89bc3..13974434 100644 --- a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/DefaultCrsTests.cs +++ b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/DefaultCrsTests.cs @@ -16,7 +16,7 @@ public void Can_Serialize_Does_Not_Output_Crs_Property() var json = JsonConvert.SerializeObject(collection); - Assert.IsTrue(!json.Contains("\"crs\"")); + Assert.That(!json.Contains("\"crs\"")); } [Test] @@ -26,7 +26,7 @@ public void Can_Deserialize_When_Json_Does_Not_Contain_Crs_Property() var point = JsonConvert.DeserializeObject(json); - Assert.IsNull(point.CRS); + Assert.That(point.CRS, Is.Null); } [Test] @@ -36,8 +36,8 @@ public void Can_Deserialize_CRS_issue_89() var point = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(point.CRS); - Assert.AreEqual(CRSType.Name, point.CRS.Type); + Assert.That(point.CRS, Is.Not.Null); + Assert.That(point.CRS.Type, Is.EqualTo(CRSType.Name)); } [Test] @@ -49,8 +49,8 @@ public void Can_Serialize_CRS_issue_89() var json = JsonConvert.SerializeObject(point); - Assert.IsNotNull(json); - Assert.AreEqual(expected, json); + Assert.That(json, Is.Not.Null); + Assert.That(json, Is.EqualTo(expected)); } [Test] @@ -62,8 +62,8 @@ public void Can_Serialize_DefaultCRS_issue_89() var json = JsonConvert.SerializeObject(point); - Assert.IsNotNull(json); - Assert.AreEqual(expected, json); + Assert.That(json, Is.Not.Null); + Assert.That(json, Is.EqualTo(expected)); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/LinkedCRSTests.cs b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/LinkedCRSTests.cs index d0897960..1bc4338b 100644 --- a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/LinkedCRSTests.cs +++ b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/LinkedCRSTests.cs @@ -15,7 +15,7 @@ public class LinkedCRSTests : TestBase public void Has_Correct_Type() { var crs = new LinkedCRS(Href); - Assert.AreEqual(CRSType.Link, crs.Type); + Assert.That(crs.Type, Is.EqualTo(CRSType.Link)); } [Test] @@ -23,8 +23,8 @@ public void Has_Href_Property_With_Href() { var crs = new LinkedCRS(Href); - Assert.IsTrue(crs.Properties.ContainsKey("href")); - Assert.AreEqual(Href, crs.Properties["href"]); + Assert.That(crs.Properties.ContainsKey("href")); + Assert.That(crs.Properties["href"], Is.EqualTo(Href)); } [Test] @@ -33,8 +33,8 @@ public void Has_Type_Property() const string type = "ogcwkt"; var crs = new LinkedCRS(Href, type); - Assert.IsTrue(crs.Properties.ContainsKey("type")); - Assert.AreEqual(type, crs.Properties["type"]); + Assert.That(crs.Properties.ContainsKey("type")); + Assert.That(crs.Properties["type"], Is.EqualTo(type)); } [Test] @@ -53,9 +53,9 @@ public void Can_Deserialize_CRS_issue_101() var pointWithCRS = JsonConvert.DeserializeObject(pointJson); var linkCRS = pointWithCRS.CRS as LinkedCRS; - Assert.IsNotNull(linkCRS); - Assert.AreEqual(CRSType.Link, linkCRS.Type); - Assert.AreEqual(Href, linkCRS.Properties["href"]); + Assert.That(linkCRS, Is.Not.Null); + Assert.That(linkCRS.Type, Is.EqualTo(CRSType.Link)); + Assert.That(linkCRS.Properties["href"], Is.EqualTo(Href)); } [Test] @@ -85,7 +85,7 @@ public void Ctor_Throws_ArgumentExpection_When_Href_Is_Not_Dereferencable_Uri() #endif var argumentExpection = Assert.Throws(() => { var crs = new LinkedCRS("http://not-a-valid-<>-url"); }); - Assert.AreEqual(expected, argumentExpection.Message); + Assert.That(argumentExpection.Message, Is.EqualTo(expected)); } [Test] @@ -106,30 +106,30 @@ public void Equals_GetHashCode_Contract() var left = new LinkedCRS(Href); var right = new LinkedCRS(Href); - Assert.AreEqual(left, right); + Assert.That(right, Is.EqualTo(left)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(right.Equals(left)); + Assert.That(left.Equals(right)); + Assert.That(right.Equals(left)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(right)); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); right = new LinkedCRS(Href + "?query=null"); - Assert.AreNotEqual(left, right); + Assert.That(right, Is.Not.EqualTo(left)); - Assert.IsFalse(left == right); - Assert.IsFalse(right == left); + Assert.That(left == right, Is.False); + Assert.That(right == left, Is.False); - Assert.IsFalse(left.Equals(right)); - Assert.IsFalse(right.Equals(left)); + Assert.That(left.Equals(right), Is.False); + Assert.That(right.Equals(left), Is.False); - Assert.AreNotEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.Not.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/NamedCrsTests.cs b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/NamedCrsTests.cs index 88bdc2bf..95cbc374 100644 --- a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/NamedCrsTests.cs +++ b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/NamedCrsTests.cs @@ -15,7 +15,7 @@ public void Has_Correct_Type() var name = "EPSG:31370"; var crs = new NamedCRS(name); - Assert.AreEqual(CRSType.Name, crs.Type); + Assert.That(crs.Type, Is.EqualTo(CRSType.Name)); } [Test] @@ -24,8 +24,8 @@ public void Has_Name_Property_With_Name() var name = "EPSG:31370"; var crs = new NamedCRS(name); - Assert.IsTrue(crs.Properties.ContainsKey("name")); - Assert.AreEqual(name, crs.Properties["name"]); + Assert.That(crs.Properties.ContainsKey("name")); + Assert.That(crs.Properties["name"], Is.EqualTo(name)); } [Test] @@ -57,31 +57,31 @@ public void Equals_GetHashCode_Contract() var left = new NamedCRS(name); var right = new NamedCRS(name); - Assert.AreEqual(left, right); + Assert.That(right, Is.EqualTo(left)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(right.Equals(left)); + Assert.That(left.Equals(right)); + Assert.That(right.Equals(left)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(right)); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); name = "EPSG:25832"; right = new NamedCRS(name); - Assert.AreNotEqual(left, right); + Assert.That(right, Is.Not.EqualTo(left)); - Assert.IsFalse(left == right); - Assert.IsFalse(right == left); + Assert.That(left == right, Is.False); + Assert.That(right == left, Is.False); - Assert.IsFalse(left.Equals(right)); - Assert.IsFalse(right.Equals(left)); + Assert.That(left.Equals(right), Is.False); + Assert.That(right.Equals(left), Is.False); - Assert.AreNotEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.Not.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/UnspecifiedCRSTests.cs b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/UnspecifiedCRSTests.cs index e6448074..e769474d 100644 --- a/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/UnspecifiedCRSTests.cs +++ b/src/GeoJSON.Net.Tests/CoordinateReferenceSystem/UnspecifiedCRSTests.cs @@ -13,7 +13,7 @@ public void Has_Correct_Type() { var crs = new UnspecifiedCRS(); - Assert.AreEqual(CRSType.Unspecified, crs.Type); + Assert.That(crs.Type, Is.EqualTo(CRSType.Unspecified)); } [Test] @@ -22,7 +22,7 @@ public void Can_Serialize_To_Null() var collection = new FeatureCollection { CRS = new UnspecifiedCRS() }; var expectedJson = "{\"type\":\"FeatureCollection\",\"crs\":null,\"features\":[] }"; var actualJson = JsonConvert.SerializeObject(collection); - + JsonAssert.AreEqual(expectedJson, actualJson); } @@ -32,7 +32,7 @@ public void Can_Deserialize_From_Null() var json = "{\"type\":\"FeatureCollection\",\"crs\":null,\"features\":[] }"; var featureCollection = JsonConvert.DeserializeObject(json); - Assert.IsInstanceOf(featureCollection.CRS); + Assert.That(featureCollection.CRS, Is.InstanceOf()); } [Test] @@ -41,18 +41,18 @@ public void Equals_GetHashCode_Contract() var left = new UnspecifiedCRS(); var right = new UnspecifiedCRS(); - Assert.AreEqual(left, right); + Assert.That(right, Is.EqualTo(left)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(right.Equals(left)); + Assert.That(left.Equals(right)); + Assert.That(right.Equals(left)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(right)); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/Feature/FeatureCollectionTests.cs b/src/GeoJSON.Net.Tests/Feature/FeatureCollectionTests.cs index fe8d606b..383c228b 100644 --- a/src/GeoJSON.Net.Tests/Feature/FeatureCollectionTests.cs +++ b/src/GeoJSON.Net.Tests/Feature/FeatureCollectionTests.cs @@ -27,12 +27,12 @@ public void Can_Deserialize() var featureCollection = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(featureCollection); - Assert.IsNotNull(featureCollection.Features); - Assert.AreEqual(featureCollection.Features.Count, 3); - Assert.AreEqual(featureCollection.Features.Count(x => x.Geometry.Type == GeoJSONObjectType.Point), 1); - Assert.AreEqual(featureCollection.Features.Count(x => x.Geometry.Type == GeoJSONObjectType.MultiPolygon), 1); - Assert.AreEqual(featureCollection.Features.Count(x => x.Geometry.Type == GeoJSONObjectType.Polygon), 1); + Assert.That(featureCollection, Is.Not.Null); + Assert.That(featureCollection.Features, Is.Not.Null); + Assert.That(featureCollection.Features.Count, Is.EqualTo(3)); + Assert.That(featureCollection.Features.Count(x => x.Geometry.Type == GeoJSONObjectType.Point), Is.EqualTo(1)); + Assert.That(featureCollection.Features.Count(x => x.Geometry.Type == GeoJSONObjectType.MultiPolygon), Is.EqualTo(1)); + Assert.That(featureCollection.Features.Count(x => x.Geometry.Type == GeoJSONObjectType.Polygon), Is.EqualTo(1)); } [Test] @@ -42,11 +42,11 @@ public void Can_DeserializeGeneric() var featureCollection = JsonConvert.DeserializeObject>(json); - Assert.IsNotNull(featureCollection); - Assert.IsNotNull(featureCollection.Features); - Assert.AreEqual(featureCollection.Features.Count, 3); - Assert.AreEqual("DD", featureCollection.Features.First().Properties.Name); - Assert.AreEqual(123, featureCollection.Features.First().Properties.Size); + Assert.That(featureCollection, Is.Not.Null); + Assert.That(featureCollection.Features, Is.Not.Null); + Assert.That(featureCollection.Features.Count, Is.EqualTo(3)); + Assert.That(featureCollection.Features.First().Properties.Name, Is.EqualTo("DD")); + Assert.That(featureCollection.Features.First().Properties.Size, Is.EqualTo(123)); } @@ -75,9 +75,9 @@ public void FeatureCollectionSerialization() var actualJson = JsonConvert.SerializeObject(model); - Assert.IsNotNull(actualJson); + Assert.That(actualJson, Is.Not.Null); - Assert.IsFalse(string.IsNullOrEmpty(actualJson)); + Assert.That(string.IsNullOrEmpty(actualJson), Is.False); } [Test] @@ -138,8 +138,8 @@ public void FeatureCollection_Test_IndexOf() var expectedId = expectedIds[i]; var expectedIndex = expectedIndexes[i]; - Assert.AreEqual(expectedId, actualId); - Assert.AreEqual(expectedIndex, actualIndex); + Assert.That(actualId, Is.EqualTo(expectedId)); + Assert.That(actualIndex, Is.EqualTo(expectedIndex)); Assert.Inconclusive("not supported. the Feature.Id is optional. " + " create a new class that inherits from" + @@ -171,21 +171,21 @@ private FeatureCollection GetFeatureCollection() private void Assert_Are_Equal(FeatureCollection left, FeatureCollection right) { - Assert.AreEqual(left, right); + Assert.That(right, Is.EqualTo(left)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(right.Equals(left)); + Assert.That(left.Equals(right)); + Assert.That(right.Equals(left)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.IsFalse(left != right); - Assert.IsFalse(right != left); + Assert.That(left != right, Is.False); + Assert.That(right != left, Is.False); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } } diff --git a/src/GeoJSON.Net.Tests/Feature/FeatureTests.cs b/src/GeoJSON.Net.Tests/Feature/FeatureTests.cs index 1b4075fa..c4b481ba 100644 --- a/src/GeoJSON.Net.Tests/Feature/FeatureTests.cs +++ b/src/GeoJSON.Net.Tests/Feature/FeatureTests.cs @@ -1,9 +1,9 @@ -using GeoJSON.Net.Geometry; -using Newtonsoft.Json; -using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; +using GeoJSON.Net.Geometry; +using Newtonsoft.Json; +using NUnit.Framework; namespace GeoJSON.Net.Tests.Feature { @@ -17,16 +17,16 @@ public void Can_Deserialize_Point_Feature() var feature = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(feature); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Any()); + Assert.That(feature, Is.Not.Null); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Any()); - Assert.IsTrue(feature.Properties.ContainsKey("name")); - Assert.AreEqual(feature.Properties["name"], "Dinagat Islands"); + Assert.That(feature.Properties.ContainsKey("name")); + Assert.That(feature.Properties["name"], Is.EqualTo("Dinagat Islands")); - Assert.AreEqual("test-id", feature.Id); + Assert.That(feature.Id, Is.EqualTo("test-id")); - Assert.AreEqual(GeoJSONObjectType.Point, feature.Geometry.Type); + Assert.That(feature.Geometry.Type, Is.EqualTo(GeoJSONObjectType.Point)); } [Test] @@ -36,11 +36,11 @@ public void Can_Deserialize_Feature_Without_Props() var feature = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(feature); - Assert.IsNotNull(feature.Properties); - Assert.IsEmpty(feature.Properties); + Assert.That(feature, Is.Not.Null); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties, Is.Empty); - Assert.AreEqual(GeoJSONObjectType.Polygon, feature.Geometry.Type); + Assert.That(feature.Geometry.Type, Is.EqualTo(GeoJSONObjectType.Polygon)); } [Test] @@ -50,13 +50,13 @@ public void Can_Deserialize_Feature_With_Null_Geometry() var feature = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(feature); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Any()); - Assert.IsTrue(feature.Properties.ContainsKey("name")); - Assert.AreEqual(feature.Properties["name"], "Unlocalized Feature"); + Assert.That(feature, Is.Not.Null); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Any()); + Assert.That(feature.Properties.ContainsKey("name")); + Assert.That(feature.Properties["name"], Is.EqualTo("Unlocalized Feature")); - Assert.IsNull(feature.Geometry); + Assert.That(feature.Geometry, Is.Null); } [Test] @@ -66,13 +66,13 @@ public void Can_Deserialize_Feature_Without_Geometry() var feature = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(feature); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Any()); - Assert.IsTrue(feature.Properties.ContainsKey("name")); - Assert.AreEqual(feature.Properties["name"], "Unlocalized Feature"); + Assert.That(feature, Is.Not.Null); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Any()); + Assert.That(feature.Properties.ContainsKey("name")); + Assert.That(feature.Properties["name"], Is.EqualTo("Unlocalized Feature")); - Assert.IsNull(feature.Geometry); + Assert.That(feature.Geometry, Is.Null); } [Test] @@ -231,7 +231,7 @@ public void Can_Serialize_Dictionary_Subclass() var expectedJson = this.GetExpectedJson(); var actualJson = JsonConvert.SerializeObject(feature); - Assert.False(string.IsNullOrEmpty(expectedJson)); + Assert.That(string.IsNullOrEmpty(expectedJson), Is.False); JsonAssert.AreEqual(expectedJson, actualJson); } @@ -250,9 +250,9 @@ public void Ctor_Can_Add_Properties_Using_Object() Net.Feature.Feature feature = new Net.Feature.Feature(new Point(new Position(10, 10)), properties); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Count > 1); - Assert.AreEqual(feature.Properties.Count, 6); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Count > 1); + Assert.That(feature.Properties.Count, Is.EqualTo(6)); } [Test] @@ -272,11 +272,10 @@ public void Ctor_Can_Add_Properties_Using_Object_Inheriting_Dictionary() Net.Feature.Feature feature = new Net.Feature.Feature(new Point(new Position(10, 10)), properties); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Count > 1); - Assert.AreEqual( - feature.Properties.Count, - expectedProperties, + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Count > 1); + Assert.That( + expectedProperties, Is.EqualTo(feature.Properties.Count), $"Expected: {expectedProperties} Actual: {feature.Properties.Count}"); } @@ -285,8 +284,8 @@ public void Ctor_Creates_Properties_Collection_When_Passed_Null_Proper_Object() { Net.Feature.Feature feature = new Net.Feature.Feature(new Point(new Position(10, 10)), (object)null); - Assert.IsNotNull(feature.Properties); - CollectionAssert.IsEmpty(feature.Properties); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties, Is.Empty); } [Test] @@ -414,8 +413,8 @@ public void Feature_Equals_Null_Issue94() equal2 = feature == null; }); - Assert.IsFalse(equal1); - Assert.IsFalse(equal2); + Assert.That(equal1, Is.False); + Assert.That(equal2, Is.False); } [Test] @@ -429,7 +428,7 @@ public void Feature_Null_Instance_Equals_Null_Issue94() equal1 = feature != null; }); - Assert.IsFalse(equal1); + Assert.That(equal1, Is.False); } [Test] @@ -445,8 +444,8 @@ public void Feature_Equals_Itself_Issue94() equal2 = feature.Equals(feature); }); - Assert.IsTrue(equal1); - Assert.IsTrue(equal2); + Assert.That(equal1); + Assert.That(equal2); } [Test] @@ -464,8 +463,8 @@ public void Feature_Equals_Geometry_Null_Issue115() equal2 = feature1.Equals(feature2); }); - Assert.IsFalse(equal1); - Assert.IsFalse(equal2); + Assert.That(equal1, Is.False); + Assert.That(equal2, Is.False); } [Test] @@ -483,8 +482,8 @@ public void Feature_Equals_Other_Geometry_Null_Issue115() equal2 = feature1.Equals(feature2); }); - Assert.IsFalse(equal1); - Assert.IsFalse(equal2); + Assert.That(equal1, Is.False); + Assert.That(equal2, Is.False); } [Test] @@ -502,8 +501,8 @@ public void Feature_Equals_All_Geometry_Null_Issue115() equal2 = feature1.Equals(feature2); }); - Assert.IsTrue(equal1); - Assert.IsTrue(equal2); + Assert.That(equal1); + Assert.That(equal2); } @@ -553,37 +552,37 @@ public static IDictionary GetPropertiesInRandomOrder() private void Assert_Are_Equal(Net.Feature.Feature left, Net.Feature.Feature right) { - Assert.AreEqual(left, right); + Assert.That(right, Is.EqualTo(left)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(right.Equals(left)); + Assert.That(left.Equals(right)); + Assert.That(right.Equals(left)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.IsFalse(left != right); - Assert.IsFalse(right != left); + Assert.That(left != right, Is.False); + Assert.That(right != left, Is.False); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } private void Assert_Are_Not_Equal(Net.Feature.Feature left, Net.Feature.Feature right) { - Assert.AreNotEqual(left, right); + Assert.That(right, Is.Not.EqualTo(left)); - Assert.IsFalse(left.Equals(right)); - Assert.IsFalse(right.Equals(left)); + Assert.That(left.Equals(right), Is.False); + Assert.That(right.Equals(left), Is.False); - Assert.IsFalse(left == right); - Assert.IsFalse(right == left); + Assert.That(left == right, Is.False); + Assert.That(right == left, Is.False); - Assert.IsTrue(left != right); - Assert.IsTrue(right != left); + Assert.That(left != right); + Assert.That(right != left); - Assert.AreNotEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.Not.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/Feature/GenericFeatureTests.cs b/src/GeoJSON.Net.Tests/Feature/GenericFeatureTests.cs index 78f0fd55..f57d73fb 100644 --- a/src/GeoJSON.Net.Tests/Feature/GenericFeatureTests.cs +++ b/src/GeoJSON.Net.Tests/Feature/GenericFeatureTests.cs @@ -17,19 +17,19 @@ public void Can_Deserialize_Point_Feature() var feature = JsonConvert.DeserializeObject>(json); - Assert.IsNotNull(feature); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Any()); + Assert.That(feature, Is.Not.Null); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Any()); - Assert.IsTrue(feature.Properties.ContainsKey("name")); - Assert.AreEqual("Dinagat Islands", feature.Properties["name"]); + Assert.That(feature.Properties.ContainsKey("name")); + Assert.That(feature.Properties["name"], Is.EqualTo("Dinagat Islands")); - Assert.AreEqual("test-id", feature.Id); + Assert.That(feature.Id, Is.EqualTo("test-id")); - Assert.AreEqual(GeoJSONObjectType.Point, feature.Geometry.Type); - Assert.AreEqual(125.6, feature.Geometry.Coordinates.Longitude); - Assert.AreEqual(10.1, feature.Geometry.Coordinates.Latitude); - Assert.AreEqual(456, feature.Geometry.Coordinates.Altitude); + Assert.That(feature.Geometry.Type, Is.EqualTo(GeoJSONObjectType.Point)); + Assert.That(feature.Geometry.Coordinates.Longitude, Is.EqualTo(125.6)); + Assert.That(feature.Geometry.Coordinates.Latitude, Is.EqualTo(10.1)); + Assert.That(feature.Geometry.Coordinates.Altitude, Is.EqualTo(456)); } [Test] @@ -39,18 +39,18 @@ public void Can_Deserialize_LineString_Feature() var feature = JsonConvert.DeserializeObject>(json); - Assert.IsNotNull(feature); - Assert.IsNotNull(feature.Properties); - Assert.IsTrue(feature.Properties.Any()); + Assert.That(feature, Is.Not.Null); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Any()); - Assert.IsTrue(feature.Properties.ContainsKey("name")); - Assert.AreEqual("Dinagat Islands", feature.Properties["name"]); + Assert.That(feature.Properties.ContainsKey("name")); + Assert.That(feature.Properties["name"], Is.EqualTo("Dinagat Islands")); - Assert.AreEqual("test-id", feature.Id); + Assert.That(feature.Id, Is.EqualTo("test-id")); - Assert.AreEqual(GeoJSONObjectType.LineString, feature.Geometry.Type); + Assert.That(feature.Geometry.Type, Is.EqualTo(GeoJSONObjectType.LineString)); - Assert.AreEqual(4, feature.Geometry.Coordinates.Count); + Assert.That(feature.Geometry.Coordinates.Count, Is.EqualTo(4)); //Assert.AreEqual(125.6, feature.Geometry.Coordinates.Longitude); //Assert.AreEqual(10.1, feature.Geometry.Coordinates.Latitude); @@ -78,8 +78,8 @@ public void Feature_Generic_Equals_Null_Issure94() equal2 = feature.Equals(null); }); - Assert.IsFalse(equal1); - Assert.IsFalse(equal2); + Assert.That(equal1, Is.False); + Assert.That(equal2, Is.False); } private class TypedFeatureProps @@ -96,15 +96,15 @@ public void Can_Deserialize_Typed_Point_Feature() var json = GetExpectedJson(); var feature = JsonConvert.DeserializeObject>(json); - Assert.IsNotNull(feature); + Assert.That(feature, Is.Not.Null); - Assert.IsNotNull(feature.Properties); - Assert.AreEqual(feature.Properties.Name, "Dinagat Islands"); - Assert.AreEqual(feature.Properties.Value, 4.2); + Assert.That(feature.Properties, Is.Not.Null); + Assert.That(feature.Properties.Name, Is.EqualTo("Dinagat Islands")); + Assert.That(feature.Properties.Value, Is.EqualTo(4.2)); - Assert.AreEqual(feature.Id, "test-id"); + Assert.That(feature.Id, Is.EqualTo("test-id")); - Assert.AreEqual(feature.Geometry.Type, GeoJSONObjectType.Point); + Assert.That(feature.Geometry.Type, Is.EqualTo(GeoJSONObjectType.Point)); } diff --git a/src/GeoJSON.Net.Tests/GeoJSON.Net.Tests.csproj b/src/GeoJSON.Net.Tests/GeoJSON.Net.Tests.csproj index f3e95507..7da78603 100644 --- a/src/GeoJSON.Net.Tests/GeoJSON.Net.Tests.csproj +++ b/src/GeoJSON.Net.Tests/GeoJSON.Net.Tests.csproj @@ -1,17 +1,21 @@  - + {6C93B314-9208-4684-B873-172F7EC81689} GeoJSON.Net.Tests GeoJSON.Net.Tests - net45;netcoreapp3.1 + net462;net6.0;net8.0 false - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + @@ -27,4 +31,4 @@ - \ No newline at end of file + diff --git a/src/GeoJSON.Net.Tests/Geometry/GeometryTests.cs b/src/GeoJSON.Net.Tests/Geometry/GeometryTests.cs index 0b9ce7db..5fc820ee 100644 --- a/src/GeoJSON.Net.Tests/Geometry/GeometryTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/GeometryTests.cs @@ -120,7 +120,7 @@ public void Can_Serialize_And_Deserialize_Geometry(IGeometryObject geometry) var deserializedGeometry = JsonConvert.DeserializeObject(json, new GeometryConverter()); - Assert.AreEqual(geometry, deserializedGeometry); + Assert.That(deserializedGeometry, Is.EqualTo(geometry)); } [Test] @@ -128,7 +128,7 @@ public void Can_Serialize_And_Deserialize_Geometry(IGeometryObject geometry) public void Serialization_Observes_Indenting_Setting_Of_Serializer(IGeometryObject geometry) { var json = JsonConvert.SerializeObject(geometry, Formatting.Indented); - Assert.IsTrue(json.Contains(Environment.NewLine)); + Assert.That(json.Contains(Environment.NewLine)); } [Test] @@ -136,8 +136,8 @@ public void Serialization_Observes_Indenting_Setting_Of_Serializer(IGeometryObje public void Serialization_Observes_No_Indenting_Setting_Of_Serializer(IGeometryObject geometry) { var json = JsonConvert.SerializeObject(geometry, Formatting.None); - Assert.IsFalse(json.Contains(Environment.NewLine)); - Assert.IsFalse(json.Contains(" ")); + Assert.That(json.Contains(Environment.NewLine), Is.False); + Assert.That(json.Contains(" "), Is.False); } [Test] @@ -150,7 +150,7 @@ public void Can_Serialize_And_Deserialize_Geometry_As_Object_Property(IGeometryO var deserializedClassWithGeometry = JsonConvert.DeserializeObject(json); - Assert.AreEqual(classWithGeometry, deserializedClassWithGeometry); + Assert.That(deserializedClassWithGeometry, Is.EqualTo(classWithGeometry)); } [Test] @@ -165,17 +165,17 @@ public void Serialized_And_Deserialized_Equals_And_Share_HashCode(IGeometryObjec var actual = classWithGeometry; var expected = deserializedClassWithGeometry; - - Assert.IsTrue(actual.Equals(expected)); - Assert.IsTrue(actual.Equals(actual)); - Assert.IsTrue(expected.Equals(actual)); - Assert.IsTrue(expected.Equals(expected)); + Assert.That(actual.Equals(expected)); + Assert.That(actual.Equals(actual)); - Assert.IsTrue(classWithGeometry == deserializedClassWithGeometry); - Assert.IsTrue(deserializedClassWithGeometry == classWithGeometry); + Assert.That(expected.Equals(actual)); + Assert.That(expected.Equals(expected)); - Assert.AreEqual(actual.GetHashCode(), expected.GetHashCode()); + Assert.That(classWithGeometry == deserializedClassWithGeometry); + Assert.That(deserializedClassWithGeometry == classWithGeometry); + + Assert.That(expected.GetHashCode(), Is.EqualTo(actual.GetHashCode())); } internal class ClassWithGeometryProperty diff --git a/src/GeoJSON.Net.Tests/Geometry/LineStringTests.cs b/src/GeoJSON.Net.Tests/Geometry/LineStringTests.cs index d203b870..dfc07d03 100644 --- a/src/GeoJSON.Net.Tests/Geometry/LineStringTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/LineStringTests.cs @@ -22,7 +22,7 @@ public void Is_Closed() var lineString = new LineString(coordinates); - Assert.IsTrue(lineString.IsClosed()); + Assert.That(lineString.IsClosed()); } [Test] @@ -38,7 +38,7 @@ public void Is_Not_Closed() var lineString = new LineString(coordinates); - Assert.IsFalse(lineString.IsClosed()); + Assert.That(lineString.IsClosed(), Is.False); } @@ -76,11 +76,11 @@ public void Can_Deserialize() var json = GetExpectedJson(); var actualLineString = JsonConvert.DeserializeObject(json); - Assert.AreEqual(expectedLineString, actualLineString); + Assert.That(actualLineString, Is.EqualTo(expectedLineString)); - Assert.AreEqual(4, actualLineString.Coordinates.Count); - Assert.AreEqual(expectedLineString.Coordinates[0].Latitude, actualLineString.Coordinates[0].Latitude); - Assert.AreEqual(expectedLineString.Coordinates[0].Longitude, actualLineString.Coordinates[0].Longitude); + Assert.That(actualLineString.Coordinates.Count, Is.EqualTo(4)); + Assert.That(actualLineString.Coordinates[0].Latitude, Is.EqualTo(expectedLineString.Coordinates[0].Latitude)); + Assert.That(actualLineString.Coordinates[0].Longitude, Is.EqualTo(expectedLineString.Coordinates[0].Longitude)); } [Test] @@ -122,18 +122,18 @@ public void Equals_GetHashCode_Contract() var left = GetLineString(offset); var right = GetLineString(offset); - Assert.AreEqual(left, right); - Assert.AreEqual(right, left); + Assert.That(right, Is.EqualTo(left)); + Assert.That(left, Is.EqualTo(right)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/Geometry/MultiLineStringTests.cs b/src/GeoJSON.Net.Tests/Geometry/MultiLineStringTests.cs index ac2b643d..37dfa3c1 100644 --- a/src/GeoJSON.Net.Tests/Geometry/MultiLineStringTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/MultiLineStringTests.cs @@ -31,8 +31,8 @@ public void Can_Deserialize() var multiLineString = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(multiLineString); - Assert.AreEqual(expectedMultiLineString, multiLineString); + Assert.That(multiLineString, Is.Not.Null); + Assert.That(multiLineString, Is.EqualTo(expectedMultiLineString)); } [Test] @@ -98,18 +98,18 @@ public void Equals_GetHashCode_Contract() var right = new MultiLineString(rightLine); - Assert.AreEqual(left, right); - Assert.AreEqual(right, left); + Assert.That(right, Is.EqualTo(left)); + Assert.That(left, Is.EqualTo(right)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/Geometry/MultiPointTests.cs b/src/GeoJSON.Net.Tests/Geometry/MultiPointTests.cs index 741f068e..4c89f655 100644 --- a/src/GeoJSON.Net.Tests/Geometry/MultiPointTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/MultiPointTests.cs @@ -40,7 +40,7 @@ public void Can_Deserialize() var json = GetExpectedJson(); var actualMultiPoint = JsonConvert.DeserializeObject(json); - Assert.AreEqual(expectedMultiPoint, actualMultiPoint); + Assert.That(actualMultiPoint, Is.EqualTo(expectedMultiPoint)); } private List GetPoints(double offset) @@ -68,18 +68,18 @@ public void Equals_GetHashCode_Contract() var left = new MultiPoint(GetPoints(offset)); var right = new MultiPoint(GetPoints(offset)); - Assert.AreEqual(left, right); - Assert.AreEqual(right, left); + Assert.That(right, Is.EqualTo(left)); + Assert.That(left, Is.EqualTo(right)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/Geometry/MultiPolygonTests.cs b/src/GeoJSON.Net.Tests/Geometry/MultiPolygonTests.cs index d9c3aa71..7913675d 100644 --- a/src/GeoJSON.Net.Tests/Geometry/MultiPolygonTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/MultiPolygonTests.cs @@ -17,7 +17,7 @@ public void Can_Deserialize() var actualMultiPolygon = JsonConvert.DeserializeObject(json); - Assert.AreEqual(expectMultiPolygon, actualMultiPolygon); + Assert.That(actualMultiPolygon, Is.EqualTo(expectMultiPolygon)); } private MultiPolygon GetMultiPolygon(double offset = 0.0) @@ -122,18 +122,18 @@ public void Equals_GetHashCode_Contract() var left = GetMultiPolygon(offset); var right = GetMultiPolygon(offset); - Assert.AreEqual(left, right); - Assert.AreEqual(right, left); + Assert.That(right, Is.EqualTo(left)); + Assert.That(left, Is.EqualTo(right)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } } } \ No newline at end of file diff --git a/src/GeoJSON.Net.Tests/Geometry/PointTests.cs b/src/GeoJSON.Net.Tests/Geometry/PointTests.cs index f27683ad..f072ddf5 100644 --- a/src/GeoJSON.Net.Tests/Geometry/PointTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/PointTests.cs @@ -40,12 +40,12 @@ public void Can_Deserialize_With_Lat_Lon_Alt() var actualPoint = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(actualPoint); - Assert.IsNotNull(actualPoint.Coordinates); - Assert.AreEqual(53.2455662, actualPoint.Coordinates.Latitude); - Assert.AreEqual(90.65464646, actualPoint.Coordinates.Longitude); - Assert.AreEqual(200.4567, actualPoint.Coordinates.Altitude); - Assert.AreEqual(expectedPoint, actualPoint); + Assert.That(actualPoint, Is.Not.Null); + Assert.That(actualPoint.Coordinates, Is.Not.Null); + Assert.That(actualPoint.Coordinates.Latitude, Is.EqualTo(53.2455662)); + Assert.That(actualPoint.Coordinates.Longitude, Is.EqualTo(90.65464646)); + Assert.That(actualPoint.Coordinates.Altitude, Is.EqualTo(200.4567)); + Assert.That(actualPoint, Is.EqualTo(expectedPoint)); } [Test] @@ -57,13 +57,13 @@ public void Can_Deserialize_With_Lat_Lon() var actualPoint = JsonConvert.DeserializeObject(json); - Assert.IsNotNull(actualPoint); - Assert.IsNotNull(actualPoint.Coordinates); - Assert.AreEqual(53.2455662, actualPoint.Coordinates.Latitude); - Assert.AreEqual(90.65464646, actualPoint.Coordinates.Longitude); - Assert.IsFalse(actualPoint.Coordinates.Altitude.HasValue); - Assert.IsNull(actualPoint.Coordinates.Altitude); - Assert.AreEqual(expectedPoint, actualPoint); + Assert.That(actualPoint, Is.Not.Null); + Assert.That(actualPoint.Coordinates, Is.Not.Null); + Assert.That(actualPoint.Coordinates.Latitude, Is.EqualTo(53.2455662)); + Assert.That(actualPoint.Coordinates.Longitude, Is.EqualTo(90.65464646)); + Assert.That(actualPoint.Coordinates.Altitude.HasValue, Is.False); + Assert.That(actualPoint.Coordinates.Altitude, Is.Null); + Assert.That(actualPoint, Is.EqualTo(expectedPoint)); } [Test] @@ -75,11 +75,11 @@ public void Equals_GetHashCode_Contract() var actualPoint = JsonConvert.DeserializeObject(json); - Assert.AreEqual(expectedPoint, actualPoint); - Assert.IsTrue(expectedPoint.Equals(actualPoint)); - Assert.IsTrue(actualPoint.Equals(expectedPoint)); + Assert.That(actualPoint, Is.EqualTo(expectedPoint)); + Assert.That(expectedPoint.Equals(actualPoint)); + Assert.That(actualPoint.Equals(expectedPoint)); - Assert.AreEqual(expectedPoint.GetHashCode(), actualPoint.GetHashCode()); + Assert.That(actualPoint.GetHashCode(), Is.EqualTo(expectedPoint.GetHashCode())); } [Test] diff --git a/src/GeoJSON.Net.Tests/Geometry/PolygonTests.cs b/src/GeoJSON.Net.Tests/Geometry/PolygonTests.cs index b55f5359..6d754641 100644 --- a/src/GeoJSON.Net.Tests/Geometry/PolygonTests.cs +++ b/src/GeoJSON.Net.Tests/Geometry/PolygonTests.cs @@ -51,7 +51,7 @@ public void Can_RoundTrip_IGeometryObject() var json = JsonConvert.SerializeObject(polygon, serializerSettings); var result = JsonConvert.DeserializeObject(json, serializerSettings); - Assert.AreEqual(result, polygon); + Assert.That(polygon, Is.EqualTo(result)); } [Test] @@ -265,7 +265,7 @@ public void Can_Deserialize_With_Exterior_And_Inner_Rings() }); var actualPolygon = JsonConvert.DeserializeObject(json); - Assert.AreEqual(expectedPolygon, actualPolygon); + Assert.That(actualPolygon, Is.EqualTo(expectedPolygon)); } [Test] @@ -286,7 +286,7 @@ public void Can_Deserialize() var actualPolygon = JsonConvert.DeserializeObject(json); - Assert.AreEqual(expectedPolygon, actualPolygon); + Assert.That(actualPolygon, Is.EqualTo(expectedPolygon)); } [Test] @@ -303,18 +303,18 @@ public void Equals_GetHashCode_Contract() var left = GetPolygon(offset); var right = GetPolygon(offset); - Assert.AreEqual(left, right); - Assert.AreEqual(right, left); + Assert.That(right, Is.EqualTo(left)); + Assert.That(left, Is.EqualTo(right)); - Assert.IsTrue(left.Equals(right)); - Assert.IsTrue(left.Equals(left)); - Assert.IsTrue(right.Equals(left)); - Assert.IsTrue(right.Equals(right)); + Assert.That(left.Equals(right)); + Assert.That(left.Equals(left)); + Assert.That(right.Equals(left)); + Assert.That(right.Equals(right)); - Assert.IsTrue(left == right); - Assert.IsTrue(right == left); + Assert.That(left == right); + Assert.That(right == left); - Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); + Assert.That(right.GetHashCode(), Is.EqualTo(left.GetHashCode())); } diff --git a/src/GeoJSON.Net.Tests/JsonAssert.cs b/src/GeoJSON.Net.Tests/JsonAssert.cs index fa8213ce..95225eee 100644 --- a/src/GeoJSON.Net.Tests/JsonAssert.cs +++ b/src/GeoJSON.Net.Tests/JsonAssert.cs @@ -20,9 +20,8 @@ public static class JsonAssert /// The actual json. public static void AreEqual(string expectJson, string actualJson) { - Assert.AreEqual( - JObject.Parse(expectJson).SortProperties().ToString(), - JObject.Parse(actualJson).SortProperties().ToString()); + Assert.That( + JObject.Parse(actualJson).SortProperties().ToString(), Is.EqualTo(JObject.Parse(expectJson).SortProperties().ToString())); } /// @@ -32,7 +31,7 @@ public static void AreEqual(string expectJson, string actualJson) /// The actual json. public static void Contains(string expectedJson, string actualJson) { - Assert.IsTrue(actualJson.Contains(expectedJson), "expected {0} to contain {1}", actualJson, expectedJson); + Assert.That(actualJson.Contains(expectedJson), $"expected {actualJson} to contain {expectedJson}"); } /// diff --git a/src/GeoJSON.Net.Tests/Serialization/JsonTests.cs b/src/GeoJSON.Net.Tests/Serialization/JsonTests.cs index 53ffa161..33e4a96e 100644 --- a/src/GeoJSON.Net.Tests/Serialization/JsonTests.cs +++ b/src/GeoJSON.Net.Tests/Serialization/JsonTests.cs @@ -16,7 +16,7 @@ public void Can_Serialize_as_GeoJSONObject() var deserialized = JsonConvert.DeserializeObject(json, new GeoJsonConverter()); - Assert.AreEqual(source, deserialized); + Assert.That(deserialized, Is.EqualTo(source)); } [Test] @@ -28,7 +28,7 @@ public void Can_Serialize_as_IGeoJSONObject() var deserialized = JsonConvert.DeserializeObject(json, new GeoJsonConverter()); - Assert.AreEqual(source, deserialized); + Assert.That(deserialized, Is.EqualTo(source)); } } } diff --git a/src/GeoJSON.Net/GeoJSON.Net.csproj b/src/GeoJSON.Net/GeoJSON.Net.csproj index 6a9df865..bac3df4b 100644 --- a/src/GeoJSON.Net/GeoJSON.Net.csproj +++ b/src/GeoJSON.Net/GeoJSON.Net.csproj @@ -1,7 +1,7 @@  - netstandard1.0;netstandard1.1;netstandard2.0;netstandard2.1;net40;net45;net5.0 + netstandard2.0;netstandard2.1;net462;net6.0;net8.0 .Net types for the GeoJSON RFC to be used with Json.Net Matt Hunt;Joerg Battermann;Xavier Fischer GeoJSON.Net @@ -23,4 +23,4 @@ $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - \ No newline at end of file +