THRIFT-5479 Add net 6 support
diff --git a/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs b/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs
index 62ab317..dd9646a 100644
--- a/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs
+++ b/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs
@@ -25,13 +25,15 @@
using Thrift.Protocol.Entities;
using Thrift.Transport.Client;
+#pragma warning disable IDE0063 // using
+
namespace Thrift.IntegrationTests.Protocols
{
[TestClass]
public class ProtocolsOperationsTests
{
- private readonly CompareLogic _compareLogic = new CompareLogic();
- private static readonly TConfiguration Configuration = null; // or new TConfiguration() if needed
+ private readonly CompareLogic _compareLogic = new();
+ private static readonly TConfiguration Configuration = new();
[DataTestMethod]
[DataRow(typeof(TBinaryProtocol), TMessageType.Call)]
@@ -496,8 +498,9 @@
{
var memoryStream = new MemoryStream();
var streamClientTransport = new TStreamTransport(memoryStream, memoryStream,Configuration);
- var protocol = (TProtocol) Activator.CreateInstance(protocolType, streamClientTransport);
- return new Tuple<Stream, TProtocol>(memoryStream, protocol);
+ if( Activator.CreateInstance(protocolType, streamClientTransport) is TProtocol protocol)
+ return new Tuple<Stream, TProtocol>(memoryStream, protocol);
+ throw new Exception("Unexpected");
}
}
}
diff --git a/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj b/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj
index 6d473e4..56123dd 100644
--- a/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj
+++ b/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj
@@ -30,6 +30,7 @@
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+ <Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>