Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 57 additions & 31 deletions src/Grpc/test/InteropTests/InteropTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace InteropTests
{
// All interop test cases, minus GCE authentication specific tests.
// Tests are separate methods so that they can be quarantined separately.
public class InteropTests
{
private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
Expand All @@ -25,10 +27,62 @@ public InteropTests(ITestOutputHelper output)
_output = output;
}

[Theory]
[Fact]
public Task EmptyUnary() => InteropTestCase("empty_unary");

[Fact]
public Task LargeUnary() => InteropTestCase("large_unary");

[Fact]
public Task ClientStreaming() => InteropTestCase("client_streaming");

[Fact]
public Task ServerStreaming() => InteropTestCase("server_streaming");

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/22101")]
[MemberData(nameof(TestCaseData))]
public async Task InteropTestCase(string name)
public Task PingPong() => InteropTestCase("ping_pong");

[Fact]
public Task EmptyStream() => InteropTestCase("empty_stream");

[Fact]
public Task CancelAfterBegin() => InteropTestCase("cancel_after_begin");

[Fact]
public Task CancelAfterFirstResponse() => InteropTestCase("cancel_after_first_response");

[Fact]
public Task TimeoutOnSleepingServer() => InteropTestCase("timeout_on_sleeping_server");

[Fact]
public Task CustomMetadata() => InteropTestCase("custom_metadata");

[Fact]
public Task StatusCodeAndMessage() => InteropTestCase("status_code_and_message");

[Fact]
public Task SpecialStatusMessage() => InteropTestCase("special_status_message");

[Fact]
public Task UnimplementedService() => InteropTestCase("unimplemented_service");

[Fact]
public Task UnimplementedMethod() => InteropTestCase("unimplemented_method");

[Fact]
public Task ClientCompressedUnary() => InteropTestCase("client_compressed_unary");

[Fact]
public Task ClientCompressedStreaming() => InteropTestCase("client_compressed_streaming");

[Fact]
public Task ServerCompressedUnary() => InteropTestCase("server_compressed_unary");

[Fact]
public Task ServerCompressedStreaming() => InteropTestCase("server_compressed_streaming");

private async Task InteropTestCase(string name)
{
using (var serverProcess = new WebsiteProcess(_serverPath, _output))
{
Expand All @@ -44,33 +98,5 @@ public async Task InteropTestCase(string name)
}
}
}

#region TestData
// All interop test cases, minus GCE authentication specific tests
private static string[] AllTests = new string[]
{
"empty_unary",
"large_unary",
"client_streaming",
"server_streaming",
"ping_pong",
"empty_stream",

"cancel_after_begin",
"cancel_after_first_response",
"timeout_on_sleeping_server",
"custom_metadata",
"status_code_and_message",
"special_status_message",
"unimplemented_service",
"unimplemented_method",
"client_compressed_unary",
"client_compressed_streaming",
"server_compressed_unary",
"server_compressed_streaming"
};

public static IEnumerable<object[]> TestCaseData => AllTests.Select(t => new object[] { t });
#endregion
}
}