mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-09-08 10:10:49 +00:00
23 lines
602 B
C#
23 lines
602 B
C#
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);
|
|
}
|
|
}
|