Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing methods to test against ObjectDisposedException
  • Loading branch information
manandre committed Jun 1, 2021
commit 5ede4a3999bbde196e76bf417159ee30e6b2b869
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ protected sealed override async Task<StreamPair> CreateConnectedStreamsAsync()
return ((NamedPipeServerStream)streams.Stream2, (NamedPipeClientStream)streams.Stream1);
}

protected async Task ValidateDisposedExceptionsAsync(NamedPipeServerStream server)
{
Assert.Throws<ObjectDisposedException>(() => server.Disconnect());
Assert.Throws<ObjectDisposedException>(() => server.GetImpersonationUserName());
Assert.Throws<ObjectDisposedException>(() => server.WaitForConnection());
await Assert.ThrowsAsync<ObjectDisposedException>(() => server.WaitForConnectionAsync());
await ValidateDisposedExceptionsAsync(server as Stream);
}

/// <summary>
/// Yields every combination of testing options for the OneWayReadWrites test
/// </summary>
Expand Down