public async Task TestWaitDisconnect() { var connections = new ConnectionsService(); connections.ClientConnected(); connections.ClientConnected(); connections.ClientDisconnected(); connections.ClientDisconnected(); connections.ClientConnected(); bool empty = false; var task = connections.WaitDisconnectAll().ContinueWith(_ => Assert.IsTrue(empty), TaskScheduler.Default); connections.ClientDisconnected(); empty = true; await task.ConfigureAwait(false); }
public async Task TestWaitDisconnectEmpty() { var connections = new ConnectionsService(); connections.ClientConnected(); connections.ClientDisconnected(); await connections.WaitDisconnectAll().ConfigureAwait(false); }