Skip to content

Commit d74730d

Browse files
committed
Mark tests obsolete and remove for net8
1 parent 365908a commit d74730d

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

test/ProjNet.Tests/ProjNET.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5-
<TargetFramework>net6</TargetFramework>
5+
<TargetFrameworks>net6;net8</TargetFrameworks>
66
<SignAssembly>true</SignAssembly>
77
<NoWarn>1701;1702;1591</NoWarn>
88
</PropertyGroup>

test/ProjNet.Tests/Serialization/BaseSerializationTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
3+
#if !NET7_0_OR_GREATER
24
using System.Runtime.Serialization;
35
using System.Runtime.Serialization.Formatters.Binary;
46

57
namespace ProjNET.Tests.Serialization
68
{
79
public class BaseSerializationTest
810
{
11+
[Obsolete("ISerializable is deprecated")]
912
public IFormatter GetFormatter()
1013
{
1114
return new BinaryFormatter();
1215
}
1316

17+
[Obsolete("ISerializable is deprecated")]
1418
public static T SanD<T>(T instance, IFormatter formatter)
1519
{
1620
using (var ms = new MemoryStream())
@@ -21,4 +25,5 @@ public static T SanD<T>(T instance, IFormatter formatter)
2125
}
2226
}
2327
}
24-
}
28+
}
29+
#endif

test/ProjNet.Tests/Serialization/CoordinateSystemsProjectionsTest.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
using NUnit.Framework;
22
using ProjNet.CoordinateSystems;
3+
using System;
34

45
namespace ProjNET.Tests.Serialization
56
{
6-
public class CoordinateSystemsProjectionsTest : BaseSerializationTest
7+
public class CoordinateSystemsProjectionsTest
8+
#if !NET7_0_OR_GREATER
9+
: BaseSerializationTest
710
{
8-
[Test]
11+
[Test, Obsolete("ISerializable is deprecated")]
912
public void TestProjectionParameterSet()
1013
{
1114
var ps = new ProjNet.CoordinateSystems.Projections.ProjectionParameterSet(
@@ -20,6 +23,9 @@ public void TestProjectionParameterSet()
2023

2124
Assert.AreEqual(ps, psD);
2225
}
26+
#else
27+
{
28+
#endif
2329

2430
[Test]
2531
public void CreateTransformationFromCoordinateSystemDeserializedFromWKT()

0 commit comments

Comments
 (0)