public IEnumerator AcceptTransport2() => RunAsync(async() => { transport2.AcceptAsync().Returns(Task.FromResult(conn1)); // transport1 task never ends transport1.AcceptAsync().Returns(Task.FromException <IConnection>(new PlatformNotSupportedException())); Assert.That(await transport.AcceptAsync(), Is.SameAs(conn1)); });
public IEnumerator AcceptTransport2() => RunAsync(async() => { transport2.AcceptAsync().Returns(Task.FromResult(conn1)); // transport1 task never ends transport1.AcceptAsync().Returns(new TaskCompletionSource <IConnection>().Task); Assert.That(await transport.AcceptAsync(), Is.SameAs(conn1)); });
public IEnumerator AcceptTransport1() => RunAsync(async() => { transport1.AcceptAsync().Returns(Task.FromResult(conn1)); Assert.That(await transport.AcceptAsync(), Is.SameAs(conn1)); });