/// <summary> /// Checks that the accepter does not provide a new endpoint info. /// </summary> private async Task VerifyNoNewEndpointInfos(ReversedDiagnosticsServer server, bool useAsync) { _outputHelper.WriteLine("Verifying there are no more connections."); var shim = new ReversedDiagnosticsServerApiShim(server, useAsync); await shim.Accept(DefaultNegativeVerificationTimeout, expectTimeout : true); _outputHelper.WriteLine("Verified there are no more connections."); }
/// <summary> /// Tests that invoking server methods with non-existing runtime identifier appropriately fail. /// </summary> private async Task ReversedServerNonExistingRuntimeIdentifierTestCore(bool useAsync) { await using var server = CreateReversedServer(out string transportName); var shim = new ReversedDiagnosticsServerApiShim(server, useAsync); server.Start(); Guid nonExistingRuntimeId = Guid.NewGuid(); _outputHelper.WriteLine($"Testing {nameof(ReversedDiagnosticsServer.WaitForConnectionAsync)}"); await shim.WaitForConnection(nonExistingRuntimeId, DefaultNegativeVerificationTimeout, expectTimeout : true); _outputHelper.WriteLine($"Testing {nameof(ReversedDiagnosticsServer.Connect)}"); await shim.Connect(nonExistingRuntimeId, DefaultNegativeVerificationTimeout, expectTimeout : true); _outputHelper.WriteLine($"Testing {nameof(ReversedDiagnosticsServer.RemoveConnection)} with previously used identifier."); Assert.True(server.RemoveConnection(nonExistingRuntimeId)); _outputHelper.WriteLine($"Testing {nameof(ReversedDiagnosticsServer.RemoveConnection)} with previously unused identifier."); Assert.False(server.RemoveConnection(Guid.NewGuid()), "Removal of nonexisting connection should fail."); }
private async Task <IpcEndpointInfo> AcceptEndpointInfo(ReversedDiagnosticsServer server, bool useAsync) { var shim = new ReversedDiagnosticsServerApiShim(server, useAsync); return(await shim.Accept(DefaultPositiveVerificationTimeout)); }