mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-09-08 10:10:49 +00:00
Port
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using Esiur.Protocol;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Tests.Unit;
|
||||
|
||||
public sealed class EpPortTests
|
||||
{
|
||||
[Fact]
|
||||
public void ServerDoesNotAssignAProtocolPort()
|
||||
=> Assert.Equal(0, new EpServer().Port);
|
||||
|
||||
[Fact]
|
||||
public async Task ClientEndpointWithoutPortIsRejected()
|
||||
{
|
||||
var warehouse = new Warehouse();
|
||||
|
||||
var exception = await Assert.ThrowsAsync<FormatException>(async () =>
|
||||
await warehouse.Get<EpConnection>("ep://localhost/sys/resource"));
|
||||
|
||||
Assert.Contains("explicit port", exception.Message, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user