Skip to content

Commit

Permalink
change UdpConnection_ThrowsException because of dotnet#47472
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Jan 26, 2021
1 parent f115490 commit 5a01870
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ public async Task NotConnected_ThrowsException()
}


[Fact]
[Theory]
[InlineData(false)]
[InlineData(true)]
[PlatformSpecific(TestPlatforms.Windows)]
public async Task UdpConnection_ThrowsException()
public async Task UdpConnection_ThrowsException(bool usePreAndPostbufferOverload)
{
// Create file to send
byte[] preBuffer;
Expand All @@ -78,8 +80,14 @@ public async Task UdpConnection_ThrowsException()

client.Connect(listener.LocalEndPoint);

await Assert.ThrowsAsync<SocketException>(() => SendFileAsync(client, tempFile.Path));
await Assert.ThrowsAsync<SocketException>(() => SendFileAsync(client, tempFile.Path, Array.Empty<byte>(), Array.Empty<byte>(), TransmitFileOptions.UseDefaultWorkerThread));
if (usePreAndPostbufferOverload)
{
await Assert.ThrowsAsync<SocketException>(() => SendFileAsync(client, tempFile.Path, Array.Empty<byte>(), Array.Empty<byte>(), TransmitFileOptions.UseDefaultWorkerThread));
}
else
{
await Assert.ThrowsAsync<SocketException>(() => SendFileAsync(client, tempFile.Path));
}
}

[Theory]
Expand Down

0 comments on commit 5a01870

Please sign in to comment.