Skip to content

Commit 4ca3988

Browse files
Merge branch 'master' into master
2 parents 4bf8112 + d0c136c commit 4ca3988

File tree

7 files changed

+103
-149
lines changed

7 files changed

+103
-149
lines changed

RUNNING_TESTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ invoked directly without using an absolute file path. Note that this method does
4949
On Windows, you must run unit tests as follows (replace `X.Y.Z` with your RabbitMQ version):
5050

5151
```
52-
set RABBITMQ_RABBITMQCTL_PATH=C:\Program Files\RabbitMQ Server\rabbitmq_server-X.Y.Z\sbin\rabbitmqctl.bat
52+
set RABBITMQ_RABBITMQCTL_PATH="C:\Program Files\RabbitMQ Server\rabbitmq_server-X.Y.Z\sbin\rabbitmqctl.bat"
5353
.\run-test.bat
5454
```
5555

projects/Apigen/apigen/Apigen.cs

Lines changed: 81 additions & 70 deletions
Large diffs are not rendered by default.

projects/RabbitMQ.Client/client/api/AmqpTimestamp.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
// Copyright (c) 2007-2020 VMware, Inc. All rights reserved.
3939
//---------------------------------------------------------------------------
4040

41+
using System;
42+
4143
namespace RabbitMQ.Client
4244
{
4345
// time representations in mainstream languages: the horror, the horror
@@ -58,7 +60,7 @@ namespace RabbitMQ.Client
5860
/// timestamps are signed or unsigned.
5961
/// </para>
6062
/// </remarks>
61-
public struct AmqpTimestamp
63+
public struct AmqpTimestamp : IEquatable<AmqpTimestamp>
6264
{
6365
/// <summary>
6466
/// Construct an <see cref="AmqpTimestamp"/>.
@@ -74,6 +76,16 @@ public AmqpTimestamp(long unixTime) : this()
7476
/// </summary>
7577
public long UnixTime { get; private set; }
7678

79+
public bool Equals(AmqpTimestamp other) => UnixTime == other.UnixTime;
80+
81+
public override bool Equals(object obj) => obj is AmqpTimestamp other && Equals(other);
82+
83+
public override int GetHashCode() => UnixTime.GetHashCode();
84+
85+
public static bool operator ==(AmqpTimestamp left, AmqpTimestamp right) => left.Equals(right);
86+
87+
public static bool operator !=(AmqpTimestamp left, AmqpTimestamp right) => !left.Equals(right);
88+
7789
/// <summary>
7890
/// Provides a debugger-friendly display.
7991
/// </summary>

projects/RabbitMQ.Client/client/api/IBasicPublishBatch.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ namespace RabbitMQ.Client
4444
{
4545
public interface IBasicPublishBatch
4646
{
47-
[Obsolete("Use Add(string exchange, string routingKey, bool mandatory, IBasicProperties properties, ReadOnlyMemory<byte> body) instead. Will be replaced in version 7.0", false)]
48-
void Add(string exchange, string routingKey, bool mandatory, IBasicProperties properties, byte[] body);
47+
void Add(string exchange, string routingKey, bool mandatory, IBasicProperties properties, ReadOnlyMemory<byte> body);
4948
void Publish();
5049
}
5150
}

projects/RabbitMQ.Client/client/impl/BasicPublishBatch.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ internal BasicPublishBatch (ModelBase model, int sizeHint)
6262
_commands = new List<Command>(sizeHint);
6363
}
6464

65-
public void Add(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, byte[] body)
66-
{
67-
ReadOnlyMemory<byte> bodyAsMemory = body;
68-
Add(exchange, routingKey, mandatory, basicProperties, bodyAsMemory);
69-
}
70-
7165
public void Add(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, ReadOnlyMemory<byte> body)
7266
{
7367
var method = new BasicPublish

projects/RabbitMQ.Client/client/impl/BasicPublishBatchExtensions.cs

Lines changed: 0 additions & 61 deletions
This file was deleted.

projects/Unit/APIApproval.Approve.verified.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ namespace RabbitMQ.Client
2323
public static RabbitMQ.Client.AmqpTcpEndpoint Parse(string address) { }
2424
public static RabbitMQ.Client.AmqpTcpEndpoint[] ParseMultiple(string addresses) { }
2525
}
26-
public struct AmqpTimestamp
26+
public struct AmqpTimestamp : System.IEquatable<RabbitMQ.Client.AmqpTimestamp>
2727
{
2828
public AmqpTimestamp(long unixTime) { }
2929
public long UnixTime { get; }
30+
public bool Equals(RabbitMQ.Client.AmqpTimestamp other) { }
31+
public override bool Equals(object obj) { }
32+
public override int GetHashCode() { }
3033
public override string ToString() { }
34+
public static bool !=(RabbitMQ.Client.AmqpTimestamp left, RabbitMQ.Client.AmqpTimestamp right) { }
35+
public static bool ==(RabbitMQ.Client.AmqpTimestamp left, RabbitMQ.Client.AmqpTimestamp right) { }
3136
}
3237
public class AsyncDefaultBasicConsumer : RabbitMQ.Client.IAsyncBasicConsumer, RabbitMQ.Client.IBasicConsumer
3338
{
@@ -56,10 +61,6 @@ namespace RabbitMQ.Client
5661
public bool Redelivered { get; }
5762
public string RoutingKey { get; }
5863
}
59-
public static class BasicPublishBatchExtensions
60-
{
61-
public static void Add(this RabbitMQ.Client.IBasicPublishBatch batch, string exchange, string routingKey, bool mandatory, RabbitMQ.Client.IBasicProperties properties, System.ReadOnlyMemory<byte> body) { }
62-
}
6364
public class BinaryTableValue
6465
{
6566
public BinaryTableValue() { }
@@ -295,9 +296,7 @@ namespace RabbitMQ.Client
295296
}
296297
public interface IBasicPublishBatch
297298
{
298-
[System.Obsolete("Use Add(string exchange, string routingKey, bool mandatory, IBasicProperties prop" +
299-
"erties, ReadOnlyMemory<byte> body) instead. Will be replaced in version 7.0", false)]
300-
void Add(string exchange, string routingKey, bool mandatory, RabbitMQ.Client.IBasicProperties properties, byte[] body);
299+
void Add(string exchange, string routingKey, bool mandatory, RabbitMQ.Client.IBasicProperties properties, System.ReadOnlyMemory<byte> body);
301300
void Publish();
302301
}
303302
public interface IConnection : RabbitMQ.Client.INetworkConnection, System.IDisposable

0 commit comments

Comments
 (0)