Skip to content

Commit 3916bd8

Browse files
committed
* Fix test for the new behavior of SelectOneAsync
1 parent 6616c4f commit 3916bd8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

projects/Test/Unit/TestIEndpointResolverExtensions.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public TestEndpointException(string message) : base(message)
6262
public class TestIEndpointResolverExtensions
6363
{
6464
[Fact]
65-
public async Task SelectOneShouldReturnDefaultWhenThereAreNoEndpoints()
65+
public Task SelectOneShouldThrowInsteadOfReturningNull()
6666
{
6767
var ep = new TestEndpointResolver(new List<AmqpTcpEndpoint>());
6868

@@ -71,7 +71,12 @@ Task<AmqpTcpEndpoint> selector(AmqpTcpEndpoint ep0, CancellationToken ct)
7171
return Task.FromResult<AmqpTcpEndpoint>(null);
7272
}
7373

74-
Assert.Null(await ep.SelectOneAsync<AmqpTcpEndpoint>(selector, CancellationToken.None));
74+
Task<AmqpTcpEndpoint> testCode()
75+
{
76+
return ep.SelectOneAsync(selector, CancellationToken.None);
77+
}
78+
79+
return Assert.ThrowsAsync<InvalidOperationException>((Func<Task<AmqpTcpEndpoint>>)testCode);
7580
}
7681

7782
[Fact]

0 commit comments

Comments
 (0)