Skip to content

Commit cfccf3a

Browse files
committed
Add dedicated types for AMQP entity properties
* `ExchangeName` and failing test.
1 parent 2320480 commit cfccf3a

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

projects/RabbitMQ.Client/PublicAPI.Unshipped.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ override RabbitMQ.Client.Logging.RabbitMqExceptionDetail.ToString() -> string
7474
override RabbitMQ.Client.PublicationAddress.ToString() -> string
7575
override RabbitMQ.Client.ShutdownEventArgs.ToString() -> string
7676
override RabbitMQ.Client.ShutdownReportEntry.ToString() -> string
77+
RabbitMQ.Client.AmqpString
78+
RabbitMQ.Client.AmqpString.AmqpString() -> void
7779
RabbitMQ.Client.AmqpTcpEndpoint
7880
RabbitMQ.Client.AmqpTcpEndpoint.AddressFamily.get -> System.Net.Sockets.AddressFamily
7981
RabbitMQ.Client.AmqpTcpEndpoint.AddressFamily.set -> void
@@ -392,6 +394,7 @@ RabbitMQ.Client.Exceptions.WireFormattingException
392394
RabbitMQ.Client.Exceptions.WireFormattingException.Offender.get -> object
393395
RabbitMQ.Client.Exceptions.WireFormattingException.WireFormattingException(string message) -> void
394396
RabbitMQ.Client.Exceptions.WireFormattingException.WireFormattingException(string message, object offender) -> void
397+
RabbitMQ.Client.ExchangeName
395398
RabbitMQ.Client.ExchangeType
396399
RabbitMQ.Client.ExternalMechanism
397400
RabbitMQ.Client.ExternalMechanism.ExternalMechanism() -> void
@@ -889,6 +892,7 @@ virtual RabbitMQ.Client.TcpClientAdapter.ReceiveTimeout.set -> void
889892
~RabbitMQ.Client.ConnectionFactory.CreateConnectionAsync(System.Collections.Generic.IEnumerable<string> hostnames, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<RabbitMQ.Client.IConnection>
890893
~RabbitMQ.Client.ConnectionFactory.CreateConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<RabbitMQ.Client.IConnection>
891894
~RabbitMQ.Client.Events.BasicDeliverEventArgs.BasicDeliverEventArgs(string consumerTag, ulong deliveryTag, bool redelivered, System.ReadOnlyMemory<byte> exchange, System.ReadOnlyMemory<byte> routingKey, in RabbitMQ.Client.ReadOnlyBasicProperties properties, System.ReadOnlyMemory<byte> body) -> void
895+
~RabbitMQ.Client.ExchangeName.ExchangeName(string exchangeName) -> void
892896
~RabbitMQ.Client.IAsyncBasicConsumer.HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, System.ReadOnlyMemory<byte> exchange, System.ReadOnlyMemory<byte> routingKey, in RabbitMQ.Client.ReadOnlyBasicProperties properties, System.ReadOnlyMemory<byte> body) -> System.Threading.Tasks.Task
893897
~RabbitMQ.Client.IBasicConsumer.HandleBasicDeliverAsync(string consumerTag, ulong deliveryTag, bool redelivered, System.ReadOnlyMemory<byte> exchange, System.ReadOnlyMemory<byte> routingKey, RabbitMQ.Client.ReadOnlyBasicProperties properties, System.ReadOnlyMemory<byte> body) -> System.Threading.Tasks.Task
894898
~RabbitMQ.Client.IChannel.BasicCancelAsync(string consumerTag, bool noWait = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 2.0.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (c) 2007-2020 VMware, Inc.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// https://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v2.0:
23+
//
24+
//---------------------------------------------------------------------------
25+
// This Source Code Form is subject to the terms of the Mozilla Public
26+
// License, v. 2.0. If a copy of the MPL was not distributed with this
27+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
28+
//
29+
// Copyright (c) 2011-2020 VMware, Inc. or its affiliates. All rights reserved.
30+
//---------------------------------------------------------------------------
31+
32+
namespace RabbitMQ.Client
33+
{
34+
public abstract class AmqpString
35+
{
36+
public AmqpString()
37+
{
38+
}
39+
}
40+
41+
public class ExchangeName : AmqpString
42+
{
43+
public ExchangeName(string exchangeName) : base()
44+
{
45+
}
46+
}
47+
}

projects/Test/Unit/TestAmqpString.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 2.0.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (c) 2007-2020 VMware, Inc.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// https://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v2.0:
23+
//
24+
//---------------------------------------------------------------------------
25+
// This Source Code Form is subject to the terms of the Mozilla Public
26+
// License, v. 2.0. If a copy of the MPL was not distributed with this
27+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
28+
//
29+
// Copyright (c) 2011-2020 VMware, Inc. or its affiliates. All rights reserved.
30+
//---------------------------------------------------------------------------
31+
32+
using System;
33+
using RabbitMQ.Client;
34+
using Xunit;
35+
36+
namespace Test.Unit
37+
{
38+
public class TestAmqpString
39+
{
40+
[Fact]
41+
public void TestInvalidExchangeNameThrows()
42+
{
43+
string e = "exchange-Евгений";
44+
Assert.Throws<ArgumentOutOfRangeException>(() => new ExchangeName(e));
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)