public override async Task RunTestCaseAsync(IRemoteObjectAdapterPrx adapter, ITestIntfPrx proxy) { Connection?con = proxy.GetCachedConnection(); TestHelper.Assert(con != null); TestHelper.Assert(con.IdleTimeout == TimeSpan.FromSeconds(1)); TestHelper.Assert(con.KeepAlive == false); con.KeepAlive = true; TestHelper.Assert(con.KeepAlive == true); try { con.IdleTimeout = TimeSpan.FromSeconds(1); } catch { } proxy.StartHeartbeatCount(); proxy.WaitForHeartbeatCount(2); var t1 = new TaskCompletionSource <object?>(); var t2 = new TaskCompletionSource <object?>(); con.Closed += (sender, args) => t1.SetResult(null); con.Closed += (sender, args) => t2.SetResult(null); await con.GoAwayAsync(); TestHelper.Assert(t1.Task.Result == null); TestHelper.Assert(t2.Task.Result == null); TestHelper.Assert(!con.IsActive); var t3 = new TaskCompletionSource <object?>(); con.Closed += (sender, args) => t3.SetResult(null); TestHelper.Assert(t3.Task.Result == null); con.PingReceived += (sender, args) => TestHelper.Assert(false); foreach ((int idleTimeout, string keepAlive) in new (int, string)[]