Skip to content

Commit 6981305

Browse files
committed
Major refactor
* Refactor test suites to use `IntegrationTest` base class * Remove IQueueDeletion and IExchangeDeletion, instead using the appropriate specification to do deletions * Increase Managment ReceiverLink credit to allow multiple management operations at the same time * Use `UrlEncode`, otherwise characters like double quotes will not be encoded correctly * Start poking around at the reconnection code * Make reconnection logic a bit easier to follow. * No need for a separate reconnection Task Minor changes Signed-off-by: Gabriele Santomaggio <[email protected]> Enforce naming for protected fields
1 parent ab35226 commit 6981305

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ dotnet_naming_symbols.constant_fields.required_modifiers = const
5151
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
5252

5353
# static fields should have s_ prefix
54-
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
54+
dotnet_naming_rule.static_fields_should_have_prefix.severity = warning
5555
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
5656
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
5757
dotnet_naming_symbols.static_fields.applicable_kinds = field
5858
dotnet_naming_symbols.static_fields.required_modifiers = static
59-
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
59+
dotnet_naming_symbols.static_fields.applicable_accessibilities = internal, private, private_protected, protected
6060
dotnet_naming_style.static_prefix_style.required_prefix = s_
6161
dotnet_naming_style.static_prefix_style.capitalization = camel_case
6262

6363
# internal and private fields should be _camelCase
64-
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
64+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = warning
6565
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
6666
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
6767
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
68-
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
68+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = internal, private, private_protected, protected
6969
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
7070
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
7171

Tests/IntegrationTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public IntegrationTest(ITestOutputHelper testOutputHelper,
3636
_queueName = $"{_testDisplayName}-queue-{Now}";
3737
_exchangeName = $"{_testDisplayName}-exchange-{Now}";
3838

39-
Type testOutputHelperType = _testOutputHelper.GetType();
39+
Type testOutputHelperType = testOutputHelper.GetType();
4040
FieldInfo? testMember = testOutputHelperType.GetField("test", BindingFlags.Instance | BindingFlags.NonPublic);
4141
if (testMember is not null)
4242
{
43-
object? testObj = testMember.GetValue(_testOutputHelper);
43+
object? testObj = testMember.GetValue(testOutputHelper);
4444
if (testObj is ITest test)
4545
{
4646
_testDisplayName = test.DisplayName;

Tests/Recovery/PublisherConsumerRecoveryTests.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task ProducerShouldChangeStatusWhenClosed()
3030
IPublisher publisher = await _connection.PublisherBuilder().Queue(queueSpec).BuildAsync();
3131

3232
List<(State, State)> states = [];
33-
publisher.ChangeState += (sender, fromState, toState, e) =>
33+
publisher.ChangeState += (_, fromState, toState, _) =>
3434
{
3535
states.Add((fromState, toState));
3636
};
@@ -68,8 +68,9 @@ public async Task ConsumerShouldChangeStatusWhenClosed()
6868
return Task.CompletedTask;
6969
}).BuildAsync();
7070

71+
7172
List<(State, State)> states = [];
72-
consumer.ChangeState += (sender, fromState, toState, e) =>
73+
consumer.ChangeState += (_, fromState, toState, _) =>
7374
{
7475
states.Add((fromState, toState));
7576
};
@@ -109,7 +110,7 @@ public async Task ProducerShouldChangeStatusWhenConnectionIsKilled()
109110
.BuildAsync();
110111

111112
List<(State, State)> states = [];
112-
publisher.ChangeState += (sender, fromState, toState, e) =>
113+
publisher.ChangeState += (_, fromState, toState, _) =>
113114
{
114115
states.Add((fromState, toState));
115116
};
@@ -156,7 +157,7 @@ public async Task ConsumerShouldChangeStatusWhenConnectionIsKilled()
156157
}).BuildAsync();
157158

158159
List<(State, State)> states = [];
159-
consumer.ChangeState += (sender, fromState, toState, e) => { states.Add((fromState, toState)); };
160+
consumer.ChangeState += (_, fromState, toState, _) => { states.Add((fromState, toState)); };
160161

161162
await SystemUtils.WaitUntilConnectionIsKilledAndOpen(_containerId);
162163

@@ -194,7 +195,7 @@ public async Task PublishShouldRestartPublishConsumerShouldRestartConsumeWhenCon
194195
long messagesReceived = 0;
195196

196197
IConsumer consumer = await _connection.ConsumerBuilder().InitialCredits(100).Queue(queueSpec)
197-
.MessageHandler(async (context, message) =>
198+
.MessageHandler(async (context, _) =>
198199
{
199200
Interlocked.Increment(ref messagesReceived);
200201
try
@@ -289,15 +290,15 @@ public async Task PublisherAndConsumerShouldNotRestartIfRecoveryIsDisabled()
289290
IPublisher publisher = await _connection.PublisherBuilder().Queue(queueSpec).BuildAsync();
290291

291292
List<(State, State)> statesProducer = [];
292-
publisher.ChangeState += (sender, fromState, toState, e) =>
293+
publisher.ChangeState += (_, fromState, toState, _) =>
293294
{
294295
statesProducer.Add((fromState, toState));
295296
};
296297

297298
IConsumer consumer = await _connection.ConsumerBuilder()
298299
.InitialCredits(100)
299300
.Queue(queueSpec)
300-
.MessageHandler(async (context, message) =>
301+
.MessageHandler(async (context, _) =>
301302
{
302303
try
303304
{
@@ -310,7 +311,7 @@ public async Task PublisherAndConsumerShouldNotRestartIfRecoveryIsDisabled()
310311
}).BuildAsync();
311312

312313
List<(State, State)> statesConsumer = [];
313-
consumer.ChangeState += (sender, fromState, toState, e) =>
314+
consumer.ChangeState += (_, fromState, toState, _) =>
314315
{
315316
statesConsumer.Add((fromState, toState));
316317
};

0 commit comments

Comments
 (0)