コード例 #1
0
 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));
 });
コード例 #2
0
 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));
 });
コード例 #3
0
        public IEnumerator AcceptTransport1() => RunAsync(async() =>
        {
            transport1.AcceptAsync().Returns(Task.FromResult(conn1));

            Assert.That(await transport.AcceptAsync(), Is.SameAs(conn1));
        });