Skip to content

Commit

Permalink
thrift URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens-G committed Apr 24, 2024
1 parent a5cc2b9 commit 73531b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lib/netstd/Tests/Thrift.Tests/UriFactory/TUriFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private enum BuiltinLayeredTransports { none, framed, buffered };
private static HashSet<BuiltinTransports> GetAllSocketTransports()
{
// these are known to slow down the test
return new HashSet<BuiltinTransports> {
return [
BuiltinTransports.socket,
BuiltinTransports.tlssocket,
};
];
}

[TestMethod]
Expand Down Expand Up @@ -78,8 +78,8 @@ public void TFactory_Can_Parse_And_Construct_Socket_Transports()
private void InternalTestMethodImplementation(IEnumerable<BuiltinProtocols> protocols, IEnumerable<BuiltinTransports> transports, IEnumerable<BuiltinProtocolDecorators> decorators, IEnumerable<BuiltinLayeredTransports> layeredTransports)
{
// those must not be empty to have at least one test run
Assert.IsTrue(protocols.Count() > 0);
Assert.IsTrue(transports.Count() > 0);
Assert.IsTrue(protocols.Any());
Assert.IsTrue(transports.Any());

// "none" should always be included and should be first
Assert.IsTrue(decorators.FirstOrDefault() == BuiltinProtocolDecorators.none);
Expand Down Expand Up @@ -126,7 +126,7 @@ private void InternalTestMethodImplementation(IEnumerable<BuiltinProtocols> prot
File.Delete(OutputFile);
}

private string MakeLayeredTransportString(BuiltinLayeredTransports layer)
private static string MakeLayeredTransportString(BuiltinLayeredTransports layer)
{
return layer switch
{
Expand Down
3 changes: 2 additions & 1 deletion lib/netstd/Thrift/TFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
using Thrift.Transport;
using Thrift.Transport.Client;

#pragma warning disable IDE0028 // collection init is net8 only
#pragma warning disable IDE0079 // unneeded suppression -> all except net8
#pragma warning disable IDE0028 // simplify collection init -> net8 only

namespace Thrift
{
Expand Down
6 changes: 3 additions & 3 deletions lib/netstd/Thrift/TThriftUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
using System.Linq;
using System.Text;

#pragma warning disable IDE0028 // net8 only
#pragma warning disable IDE0074 // net8 only
//#pragma warning disable IDE0028 // net8 only
//#pragma warning disable IDE0074 // net8 only

namespace Thrift
{
Expand All @@ -32,7 +32,7 @@ public class TThriftUri
// must either be empty or begin with a slash("/") character.If a URI
// does not contain an authority component, then the path cannot begin
// with two slash characters("//").
public const string THRIFT_URI_SCHEME = "thrift:/";
public const string THRIFT_URI_SCHEME = "thrift:";

public readonly string Protocol;
public readonly string Transport;
Expand Down

0 comments on commit 73531b5

Please sign in to comment.