From 5e24a3451b31e57c016478b792c51d0bb9783f8d Mon Sep 17 00:00:00 2001 From: Anthony Steele Date: Fri, 12 Apr 2019 18:01:15 +0100 Subject: [PATCH] run dotnet format (#537) run `dotnet format` --- .../WhenOneBusIsSubscribedToTwoRegions.cs | 2 +- .../WhenOneBusIsSubscribedToTwoRegions.cs | 2 +- JustSaying.Models/Message.cs | 2 +- JustSaying.Tools/CommandParser.cs | 8 ++++---- .../MessageHandling/ExactlyOnceReaderTests.cs | 4 ++-- .../AwsTools/MessageHandling/HandlerMapTests.cs | 4 ++-- .../MessageHandling/MessageContextAccessorTests.cs | 2 +- .../MessageDispatcherTests/WhenDispatchingMessage.cs | 4 ++-- .../MessageHandling/MessageHandlerWrapperTests.cs | 2 +- .../Sns/TopicByName/WhenPublishingTestBase.cs | 2 +- .../AwsTools/MessageHandling/Sqs/WhenPublishing.cs | 2 +- .../MessageHandling/Sqs/WhenPublishingAsync.cs | 8 ++++---- .../MessageHandling/Sqs/WhenPublishingTestBase.cs | 2 +- .../Support/SignallingHandler.cs | 2 +- .../WhenAttemptingToInterrogateASubscriber.cs | 2 +- .../WhenExactlyOnceIsAppliedToHandler.cs | 6 +++--- .../WhenThereAreExceptionsInSqsCalling.cs | 2 +- .../WhenThereAreNoMessagesToProcess.cs | 2 +- .../QueueCreation/WhenSerializingRedrivePolicy.cs | 2 +- .../WhenPublishingMessageWithoutMonitor.cs | 2 +- .../JustSayingBus/WhenRegisteringMessageHandlers.cs | 2 +- .../JustSayingBus/WhenRegisteringSubscribers.cs | 2 +- .../WhenSubscribingAndNotPassingATopic.cs | 2 +- .../JustSayingBus/WhenUsingMultipleRegions.cs | 2 +- .../WhenEnsuringMessageIsOnlyHandledExactlyOnce.cs | 2 +- .../Messaging/Monitoring/StopwatchHandlerTests.cs | 6 +++--- .../Newtonsoft/WhenAskingForANewSerializer.cs | 2 +- .../Newtonsoft/WhenSerializingAndDeserializing.cs | 2 +- .../Newtonsoft/WhenUsingCustomSettings.cs | 3 ++- .../WhenDeserializingMessage.cs | 2 +- .../GenericMessageSubjectProviderTests.cs | 2 +- JustSaying.UnitTests/XBehaviourTest.cs | 4 ++-- JustSaying/AwsTools/DefaultAwsClientFactory.cs | 2 +- JustSaying/AwsTools/JustSayingConstants.cs | 4 ++-- .../AwsTools/MessageHandling/MessageDispatcher.cs | 2 +- .../AwsTools/MessageHandling/PublishException.cs | 2 +- JustSaying/AwsTools/MessageHandling/SnsTopicBase.cs | 2 +- JustSaying/AwsTools/MessageHandling/SqsQueueBase.cs | 12 ++++++------ .../AwsTools/MessageHandling/SqsQueueByName.cs | 8 ++++---- .../QueueCreation/ConfigurationErrorsException.cs | 2 +- .../AwsTools/QueueCreation/ServerSideEncryption.cs | 6 +++--- JustSaying/CreateMeABus.cs | 2 +- .../HandlerNotRegisteredWithContainerException.cs | 4 ++-- JustSaying/IPublishConfiguration.cs | 2 +- JustSaying/JustSayingBus.cs | 2 +- JustSaying/JustSayingFluently.cs | 4 ++-- .../Interrogation/IInterrogationResponse.cs | 2 +- .../Messaging/Interrogation/InterrogationResponse.cs | 2 +- .../MessageSerialization/NewtonsoftSerializer.cs | 8 ++++---- 49 files changed, 80 insertions(+), 79 deletions(-) diff --git a/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsPointToPointSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs b/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsPointToPointSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs index 89c5176bf..334528bf0 100644 --- a/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsPointToPointSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs +++ b/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsPointToPointSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs @@ -61,7 +61,7 @@ private void GivenASubscriptionToAQueueInTwoRegions(string primaryRegion, string handler.Handle(Arg.Any()).Returns(true); handler .When(x => x.Handle(Arg.Any())) - .Do(async x => await _handler.Complete((SimpleMessage) x.Args()[0])); + .Do(async x => await _handler.Complete((SimpleMessage)x.Args()[0])); _subscriber = CreateMeABus .WithLogging(LoggerFactory) diff --git a/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsTopicSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs b/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsTopicSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs index db9d533cc..e4f54a33f 100644 --- a/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsTopicSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs +++ b/JustSaying.IntegrationTests/JustSayingFluently/MultiRegion/WithSqsTopicSubscriber/WhenOneBusIsSubscribedToTwoRegions.cs @@ -61,7 +61,7 @@ private void GivenASubscriptionToAQueueInTwoRegions(string primaryRegion, string handler.Handle(Arg.Any()).Returns(true); handler .When(x => x.Handle(Arg.Any())) - .Do(async x => await _handler.Complete((SimpleMessage) x.Args()[0])); + .Do(async x => await _handler.Complete((SimpleMessage)x.Args()[0])); _subscriber = CreateMeABus .WithLogging(LoggerFactory) diff --git a/JustSaying.Models/Message.cs b/JustSaying.Models/Message.cs index 23d0ba4d9..6ca7d78fd 100644 --- a/JustSaying.Models/Message.cs +++ b/JustSaying.Models/Message.cs @@ -13,7 +13,7 @@ protected Message() public Guid Id { get; set; } public DateTime TimeStamp { get; set; } public string RaisingComponent { get; set; } - public string Version{ get; private set; } + public string Version { get; private set; } public string SourceIp { get; private set; } public string Tenant { get; set; } public string Conversation { get; set; } diff --git a/JustSaying.Tools/CommandParser.cs b/JustSaying.Tools/CommandParser.cs index 491df2150..447222a87 100644 --- a/JustSaying.Tools/CommandParser.cs +++ b/JustSaying.Tools/CommandParser.cs @@ -26,18 +26,18 @@ await CommandLine private static void InitializeCommandLineParser(ICommandLineElementParser x) { x.Add((from arg in x.Argument("exit") - select (ICommand) new ExitCommand()) + select (ICommand)new ExitCommand()) .Or(from arg in x.Argument("quit") - select (ICommand) new ExitCommand()) + select (ICommand)new ExitCommand()) .Or(from arg in x.Argument("help") - select (ICommand) new HelpCommand()) + select (ICommand)new HelpCommand()) .Or(from arg in x.Argument("move") from sourceQueueName in x.Definition("from") from destinationQueueName in x.Definition("to") from region in x.Definition("in") from count in (from d in x.Definition("count") select d).Optional("count", "1") - select (ICommand) new MoveCommand(sourceQueueName.Value, destinationQueueName.Value, region.Value, + select (ICommand)new MoveCommand(sourceQueueName.Value, destinationQueueName.Value, region.Value, int.Parse(count.Value, CultureInfo.InvariantCulture))) ); } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/ExactlyOnceReaderTests.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/ExactlyOnceReaderTests.cs index ab7103a1c..af8f14258 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/ExactlyOnceReaderTests.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/ExactlyOnceReaderTests.cs @@ -9,7 +9,7 @@ public class ExactlyOnceReaderTests [Fact] public void ObjectTypeDoesNotHaveExactlyOnce() { - var reader = new ExactlyOnceReader(typeof (object)); + var reader = new ExactlyOnceReader(typeof(object)); reader.Enabled.ShouldBeFalse(); } @@ -25,7 +25,7 @@ public void UnadornedHandlerType_DoesNotHaveExactlyOnce() [Fact] public void OnceTestHandlerAsyncType_HasExactlyOnce() { - var reader = new ExactlyOnceReader(typeof (OnceTestHandlerAsync)); + var reader = new ExactlyOnceReader(typeof(OnceTestHandlerAsync)); reader.Enabled.ShouldBeTrue(); } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/HandlerMapTests.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/HandlerMapTests.cs index 440ab03d9..0e1cf9808 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/HandlerMapTests.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/HandlerMapTests.cs @@ -31,7 +31,7 @@ public void EmptyMapReturnsNullHandlers() public void HandlerIsReturnedForMatchingType() { var map = new HandlerMap(); - map.Add(typeof(SimpleMessage), m => Task.FromResult(true) ); + map.Add(typeof(SimpleMessage), m => Task.FromResult(true)); var handler = map.Get(typeof(SimpleMessage)); @@ -72,7 +72,7 @@ public void CorrectHandlerIsReturnedForType() var handler1 = map.Get(typeof(SimpleMessage)); handler1.ShouldBe(fn1); - + var handler2 = map.Get(typeof(AnotherSimpleMessage)); handler2.ShouldBe(fn2); diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/MessageContextAccessorTests.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/MessageContextAccessorTests.cs index dd7da7bc2..c0288d02a 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/MessageContextAccessorTests.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/MessageContextAccessorTests.cs @@ -49,7 +49,7 @@ public async Task DifferentThreadsHaveDifferentContexts() var data2 = MakeUniqueMessageContext(); var t1 = Task.Run(async () => await ThreadLocalDataRemainsTheSame(data1)); - var t2 = Task.Run(async () => await ThreadLocalDataRemainsTheSame(data2)); + var t2 = Task.Run(async () => await ThreadLocalDataRemainsTheSame(data2)); await Task.WhenAll(t1, t2); } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/MessageDispatcherTests/WhenDispatchingMessage.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/MessageDispatcherTests/WhenDispatchingMessage.cs index e64dd4691..0e2df4875 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/MessageDispatcherTests/WhenDispatchingMessage.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/MessageDispatcherTests/WhenDispatchingMessage.cs @@ -86,7 +86,7 @@ protected virtual void Given() _serializationRegister.DeserializeMessage(Arg.Any()).Returns(_typedMessage); } - private async Task When() => await SystemUnderTest.DispatchMessage(_sqsMessage, CancellationToken.None); + private async Task When() => await SystemUnderTest.DispatchMessage(_sqsMessage, CancellationToken.None); private MessageDispatcher CreateSystemUnderTestAsync() { @@ -144,7 +144,7 @@ public void ShouldInvokeMessageBackoffStrategyWithNumberOfReceives() [Fact] public void ShouldUpdateMessageVisibility() { - _amazonSqsClient.Received(1).ChangeMessageVisibilityAsync(Arg.Is(x => x.QueueUrl == ExpectedQueueUrl && x.ReceiptHandle == _sqsMessage.ReceiptHandle && x.VisibilityTimeout == (int) _expectedBackoffTimeSpan.TotalSeconds)); + _amazonSqsClient.Received(1).ChangeMessageVisibilityAsync(Arg.Is(x => x.QueueUrl == ExpectedQueueUrl && x.ReceiptHandle == _sqsMessage.ReceiptHandle && x.VisibilityTimeout == (int)_expectedBackoffTimeSpan.TotalSeconds)); } } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/MessageHandlerWrapperTests.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/MessageHandlerWrapperTests.cs index c3f83d22f..2c44d4f50 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/MessageHandlerWrapperTests.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/MessageHandlerWrapperTests.cs @@ -33,7 +33,7 @@ public async Task ReturnedFunctionIsCallable() mockHandler.Handle(Arg.Any()).Returns(true); // act - var wrapped = handlerWrapper.WrapMessageHandler(() => mockHandler); + var wrapped = handlerWrapper.WrapMessageHandler(() => mockHandler); var result = await wrapped(new SimpleMessage()); diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/Sns/TopicByName/WhenPublishingTestBase.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/Sns/TopicByName/WhenPublishingTestBase.cs index 8cb47d094..b8dd54532 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/Sns/TopicByName/WhenPublishingTestBase.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/Sns/TopicByName/WhenPublishingTestBase.cs @@ -35,6 +35,6 @@ public virtual Task DisposeAsync() protected abstract void Given(); protected abstract Task CreateSystemUnderTestAsync(); - protected abstract Task WhenAsync(); + protected abstract Task WhenAsync(); } } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishing.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishing.cs index 834dc439a..2bddc41d5 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishing.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishing.cs @@ -29,7 +29,7 @@ protected override async Task CreateSystemUnderTestAsync() protected override void Given() { Sqs.GetQueueUrlAsync(Arg.Any()) - .Returns(new GetQueueUrlResponse {QueueUrl = Url}); + .Returns(new GetQueueUrlResponse { QueueUrl = Url }); Sqs.GetQueueAttributesAsync(Arg.Any()) .Returns(new GetQueueAttributesResponse()); diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingAsync.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingAsync.cs index c3f52c054..a39c07f5c 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingAsync.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingAsync.cs @@ -28,11 +28,11 @@ protected override async Task CreateSystemUnderTestAsync() protected override void Given() { - Sqs.GetQueueUrlAsync(Arg.Any()) - .Returns(new GetQueueUrlResponse { QueueUrl = Url }); + Sqs.GetQueueUrlAsync(Arg.Any()) + .Returns(new GetQueueUrlResponse { QueueUrl = Url }); - Sqs.GetQueueAttributesAsync(Arg.Any()) - .Returns(new GetQueueAttributesResponse()); + Sqs.GetQueueAttributesAsync(Arg.Any()) + .Returns(new GetQueueAttributesResponse()); _serializationRegister.Serialize(_message, false) .Returns("serialized_contents"); diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingTestBase.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingTestBase.cs index 35bd06f49..4a61d8274 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingTestBase.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/Sqs/WhenPublishingTestBase.cs @@ -34,6 +34,6 @@ public virtual Task DisposeAsync() protected abstract void Given(); protected abstract Task CreateSystemUnderTestAsync(); - protected abstract Task WhenAsync(); + protected abstract Task WhenAsync(); } } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/Support/SignallingHandler.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/Support/SignallingHandler.cs index e61c63695..1c2ec8f10 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/Support/SignallingHandler.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/Support/SignallingHandler.cs @@ -21,7 +21,7 @@ public async Task Handle(T message) { return await _inner.Handle(message); } - finally + finally { TaskHelpers.DelaySendDone(_doneSignal); } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenAttemptingToInterrogateASubscriber.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenAttemptingToInterrogateASubscriber.cs index 2f9af2fca..fc5e72dc6 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenAttemptingToInterrogateASubscriber.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenAttemptingToInterrogateASubscriber.cs @@ -11,7 +11,7 @@ public class WhenAttemptingToInterrogateASubscriber : BaseQueuePollingTest public void SubscribedMessagesAreAddedToTheInterrogationDetails() { SystemUnderTest.Subscribers.Count.ShouldBe(1); - SystemUnderTest.Subscribers.First(x => x.MessageType == typeof (SimpleMessage)).ShouldNotBe(null); + SystemUnderTest.Subscribers.First(x => x.MessageType == typeof(SimpleMessage)).ShouldNotBe(null); } } } diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenExactlyOnceIsAppliedToHandler.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenExactlyOnceIsAppliedToHandler.cs index 724485385..67584e6f6 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenExactlyOnceIsAppliedToHandler.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenExactlyOnceIsAppliedToHandler.cs @@ -22,9 +22,9 @@ protected override void Given() _expectedTimeout = 5; var messageLockResponse = new MessageLockResponse - { - DoIHaveExclusiveLock = true - }; + { + DoIHaveExclusiveLock = true + }; MessageLock = Substitute.For(); MessageLock.TryAquireLockAsync(Arg.Any(), Arg.Any()) diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreExceptionsInSqsCalling.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreExceptionsInSqsCalling.cs index aae132d54..920835db0 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreExceptionsInSqsCalling.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreExceptionsInSqsCalling.cs @@ -33,7 +33,7 @@ protected override void Given() Sqs.ReceiveMessageAsync( Arg.Any(), Arg.Any()) - .Returns(_ => ExceptionOnFirstCall()); + .Returns(_ => ExceptionOnFirstCall()); } private Task ExceptionOnFirstCall() diff --git a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreNoMessagesToProcess.cs b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreNoMessagesToProcess.cs index b5c18bf4e..133314882 100644 --- a/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreNoMessagesToProcess.cs +++ b/JustSaying.UnitTests/AwsTools/MessageHandling/SqsNotificationListener/WhenThereAreNoMessagesToProcess.cs @@ -59,7 +59,7 @@ private void Given() Arg.Any()) .Returns(x => Task.FromResult(GenerateEmptyMessage())); - _sqs.When(x => x.ReceiveMessageAsync( + _sqs.When(x => x.ReceiveMessageAsync( Arg.Any(), Arg.Any())) .Do(x => _callCount++); diff --git a/JustSaying.UnitTests/AwsTools/QueueCreation/WhenSerializingRedrivePolicy.cs b/JustSaying.UnitTests/AwsTools/QueueCreation/WhenSerializingRedrivePolicy.cs index 027541fc5..bf30549ec 100644 --- a/JustSaying.UnitTests/AwsTools/QueueCreation/WhenSerializingRedrivePolicy.cs +++ b/JustSaying.UnitTests/AwsTools/QueueCreation/WhenSerializingRedrivePolicy.cs @@ -4,7 +4,7 @@ namespace JustSaying.UnitTests.AwsTools.QueueCreation { - public class WhenSerializingRedrivePolicy + public class WhenSerializingRedrivePolicy { [Fact] public void CanDeserializeIntoRedrivePolicy() diff --git a/JustSaying.UnitTests/JustSayingBus/WhenPublishingMessageWithoutMonitor.cs b/JustSaying.UnitTests/JustSayingBus/WhenPublishingMessageWithoutMonitor.cs index 2584a4b91..be8e5e050 100644 --- a/JustSaying.UnitTests/JustSayingBus/WhenPublishingMessageWithoutMonitor.cs +++ b/JustSaying.UnitTests/JustSayingBus/WhenPublishingMessageWithoutMonitor.cs @@ -11,7 +11,7 @@ namespace JustSaying.UnitTests.JustSayingBus public class WhenPublishingMessageWithoutMonitor : GivenAServiceBusWithoutMonitoring { private readonly IMessagePublisher _publisher = Substitute.For(); - + protected override async Task WhenAsync() { SystemUnderTest.AddMessagePublisher(_publisher, string.Empty); diff --git a/JustSaying.UnitTests/JustSayingBus/WhenRegisteringMessageHandlers.cs b/JustSaying.UnitTests/JustSayingBus/WhenRegisteringMessageHandlers.cs index 3d4e724c9..194e5dd2b 100644 --- a/JustSaying.UnitTests/JustSayingBus/WhenRegisteringMessageHandlers.cs +++ b/JustSaying.UnitTests/JustSayingBus/WhenRegisteringMessageHandlers.cs @@ -16,7 +16,7 @@ public class WhenRegisteringMessageHandlers : GivenAServiceBus private string _region; private Func> _futureHandler1; private Func> _futureHandler2; - + protected override void Given() { base.Given(); diff --git a/JustSaying.UnitTests/JustSayingBus/WhenRegisteringSubscribers.cs b/JustSaying.UnitTests/JustSayingBus/WhenRegisteringSubscribers.cs index 26892eab1..0bfb8d17f 100644 --- a/JustSaying.UnitTests/JustSayingBus/WhenRegisteringSubscribers.cs +++ b/JustSaying.UnitTests/JustSayingBus/WhenRegisteringSubscribers.cs @@ -27,7 +27,7 @@ protected override void Given() }); _subscriber2 = Substitute.For(); _subscriber2.Queue.Returns("queue2"); - _subscriber2.Subscribers.Returns(new Collection {new Subscriber(typeof (SimpleMessage))}); + _subscriber2.Subscribers.Returns(new Collection { new Subscriber(typeof(SimpleMessage)) }); } protected override Task WhenAsync() diff --git a/JustSaying.UnitTests/JustSayingBus/WhenSubscribingAndNotPassingATopic.cs b/JustSaying.UnitTests/JustSayingBus/WhenSubscribingAndNotPassingATopic.cs index 38c007d2e..2580d020e 100644 --- a/JustSaying.UnitTests/JustSayingBus/WhenSubscribingAndNotPassingATopic.cs +++ b/JustSaying.UnitTests/JustSayingBus/WhenSubscribingAndNotPassingATopic.cs @@ -22,7 +22,7 @@ protected override Task WhenAsync() [Fact] public void ArgExceptionThrown() { - ((ArgumentException) ThrownException).ParamName.ShouldBe("region"); + ((ArgumentException)ThrownException).ParamName.ShouldBe("region"); } } } diff --git a/JustSaying.UnitTests/JustSayingBus/WhenUsingMultipleRegions.cs b/JustSaying.UnitTests/JustSayingBus/WhenUsingMultipleRegions.cs index 088835093..ba2991c40 100644 --- a/JustSaying.UnitTests/JustSayingBus/WhenUsingMultipleRegions.cs +++ b/JustSaying.UnitTests/JustSayingBus/WhenUsingMultipleRegions.cs @@ -12,7 +12,7 @@ public class WhenUsingMultipleRegions : GivenAServiceBus protected override void Given() { base.Given(); - Config.Regions.Returns(new List{"region1", "region2"}); + Config.Regions.Returns(new List { "region1", "region2" }); } protected override Task WhenAsync() diff --git a/JustSaying.UnitTests/Messaging/MessageHandling/WhenEnsuringMessageIsOnlyHandledExactlyOnce.cs b/JustSaying.UnitTests/Messaging/MessageHandling/WhenEnsuringMessageIsOnlyHandledExactlyOnce.cs index e136a39b2..eb8c99b1f 100644 --- a/JustSaying.UnitTests/Messaging/MessageHandling/WhenEnsuringMessageIsOnlyHandledExactlyOnce.cs +++ b/JustSaying.UnitTests/Messaging/MessageHandling/WhenEnsuringMessageIsOnlyHandledExactlyOnce.cs @@ -14,7 +14,7 @@ public class WhenEnsuringMessageIsOnlyHandledExactlyOnce public async Task WhenMessageIsLockedByAnotherHandler_MessageWillBeLeftInTheQueue() { var messageLock = Substitute.For(); - messageLock.TryAquireLockAsync(Arg.Any(), Arg.Any()).Returns(new MessageLockResponse {DoIHaveExclusiveLock = false}); + messageLock.TryAquireLockAsync(Arg.Any(), Arg.Any()).Returns(new MessageLockResponse { DoIHaveExclusiveLock = false }); var sut = new ExactlyOnceHandler(Substitute.For>(), messageLock, 1, "handlerName"); var result = await sut.Handle(new OrderAccepted()); diff --git a/JustSaying.UnitTests/Messaging/Monitoring/StopwatchHandlerTests.cs b/JustSaying.UnitTests/Messaging/Monitoring/StopwatchHandlerTests.cs index 584e3d6ba..cd38e45bb 100644 --- a/JustSaying.UnitTests/Messaging/Monitoring/StopwatchHandlerTests.cs +++ b/JustSaying.UnitTests/Messaging/Monitoring/StopwatchHandlerTests.cs @@ -21,7 +21,7 @@ public async Task WhenHandlerIsWrappedinStopWatch_InnerHandlerIsCalled() var result = await stopWatchHandler.Handle(new OrderAccepted()); result.ShouldBeTrue(); - + await handler.Received(1).Handle(Arg.Any()); } @@ -35,7 +35,7 @@ public async Task WhenHandlerIsWrappedinStopWatch_MonitoringIsCalled() await stopWatchHandler.Handle(new OrderAccepted()); - monitoring.Received(1). HandlerExecutionTime( + monitoring.Received(1).HandlerExecutionTime( Arg.Any(), Arg.Any(), Arg.Any()); } @@ -66,7 +66,7 @@ public async Task WhenHandlerIsWrappedinStopWatch_MonitoringIsCalledWithTiming() await stopWatchHandler.Handle(new OrderAccepted()); monitoring.Received(1).HandlerExecutionTime( - Arg.Any(), Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Is(ts => ts > TimeSpan.Zero)); } diff --git a/JustSaying.UnitTests/Messaging/Serialization/Newtonsoft/WhenAskingForANewSerializer.cs b/JustSaying.UnitTests/Messaging/Serialization/Newtonsoft/WhenAskingForANewSerializer.cs index c9254e646..a4a660d5d 100644 --- a/JustSaying.UnitTests/Messaging/Serialization/Newtonsoft/WhenAskingForANewSerializer.cs +++ b/JustSaying.UnitTests/Messaging/Serialization/Newtonsoft/WhenAskingForANewSerializer.cs @@ -11,7 +11,7 @@ public class WhenAskingForANewSerializer : XBehaviourTest(); messageSerializer.GetMessageSubject(messageBody).Returns(typeof(CustomMessage).Name); - messageSerializer.Deserialize(messageBody, typeof (CustomMessage)).Returns(new CustomMessage()); + messageSerializer.Deserialize(messageBody, typeof(CustomMessage)).Returns(new CustomMessage()); SystemUnderTest.AddSerializer(messageSerializer); } diff --git a/JustSaying.UnitTests/Messaging/Serialization/SubjectProviders/GenericMessageSubjectProviderTests.cs b/JustSaying.UnitTests/Messaging/Serialization/SubjectProviders/GenericMessageSubjectProviderTests.cs index c6de1929a..9d36bf0a7 100644 --- a/JustSaying.UnitTests/Messaging/Serialization/SubjectProviders/GenericMessageSubjectProviderTests.cs +++ b/JustSaying.UnitTests/Messaging/Serialization/SubjectProviders/GenericMessageSubjectProviderTests.cs @@ -6,7 +6,7 @@ namespace JustSaying.UnitTests.Messaging.Serialization.SubjectProviders { public class GenericMessageSubjectProviderTests { -// these classes are never instantiated, but the types are used in tests + // these classes are never instantiated, but the types are used in tests #pragma warning disable CA1812 class Foo { } diff --git a/JustSaying.UnitTests/XBehaviourTest.cs b/JustSaying.UnitTests/XBehaviourTest.cs index 7d1eb9e4b..eaf4ade25 100644 --- a/JustSaying.UnitTests/XBehaviourTest.cs +++ b/JustSaying.UnitTests/XBehaviourTest.cs @@ -14,7 +14,7 @@ protected XBehaviourTest() protected TSystemUnderTest SystemUnderTest { get; private set; } protected Exception ThrownException { get; private set; } - + protected virtual TSystemUnderTest CreateSystemUnderTest() { var fixture = new Fixture(); @@ -30,7 +30,7 @@ protected void Execute() SystemUnderTest = CreateSystemUnderTest(); WhenAction(); } - catch (Exception ex) when(_recordThrownExceptions) + catch (Exception ex) when (_recordThrownExceptions) { ThrownException = ex; } diff --git a/JustSaying/AwsTools/DefaultAwsClientFactory.cs b/JustSaying/AwsTools/DefaultAwsClientFactory.cs index 6d1b573e7..d1f1466c7 100644 --- a/JustSaying/AwsTools/DefaultAwsClientFactory.cs +++ b/JustSaying/AwsTools/DefaultAwsClientFactory.cs @@ -22,7 +22,7 @@ public DefaultAwsClientFactory(AWSCredentials customCredentials) public Uri ServiceUri { get; set; } - public IAmazonSimpleNotificationService GetSnsClient(RegionEndpoint region) + public IAmazonSimpleNotificationService GetSnsClient(RegionEndpoint region) => new AmazonSimpleNotificationServiceClient(_credentials, CreateSNSConfig(region)); public IAmazonSQS GetSqsClient(RegionEndpoint region) diff --git a/JustSaying/AwsTools/JustSayingConstants.cs b/JustSaying/AwsTools/JustSayingConstants.cs index 87ae8e6e2..20d890880 100644 --- a/JustSaying/AwsTools/JustSayingConstants.cs +++ b/JustSaying/AwsTools/JustSayingConstants.cs @@ -17,7 +17,7 @@ public static class JustSayingConstants /// Default visibility timeout for message /// public static TimeSpan DefaultVisibilityTimeout => TimeSpan.FromSeconds(30); - + /// /// Number of times a handler will retry a message until a message /// is sent to error queue @@ -49,7 +49,7 @@ public static class JustSayingConstants /// Maximum message retention period on a queue. /// public static TimeSpan MaximumRetentionPeriod => TimeSpan.FromDays(14); - + /// /// Minimum delay in message delivery for SQS. This is also the default. /// diff --git a/JustSaying/AwsTools/MessageHandling/MessageDispatcher.cs b/JustSaying/AwsTools/MessageHandling/MessageDispatcher.cs index dcb1f3bc2..0285405c0 100644 --- a/JustSaying/AwsTools/MessageHandling/MessageDispatcher.cs +++ b/JustSaying/AwsTools/MessageHandling/MessageDispatcher.cs @@ -152,7 +152,7 @@ private async Task DeleteMessageFromQueue(string receiptHandle) await _queue.Client.DeleteMessageAsync(deleteRequest).ConfigureAwait(false); } - + private async Task UpdateMessageVisibilityTimeout(SQSMessage message, string receiptHandle, Message typedMessage, Exception lastException) { if (TryGetApproxReceiveCount(message.Attributes, out int approxReceiveCount)) diff --git a/JustSaying/AwsTools/MessageHandling/PublishException.cs b/JustSaying/AwsTools/MessageHandling/PublishException.cs index efe3534ac..2bc80ba0d 100644 --- a/JustSaying/AwsTools/MessageHandling/PublishException.cs +++ b/JustSaying/AwsTools/MessageHandling/PublishException.cs @@ -6,7 +6,7 @@ namespace JustSaying.AwsTools.MessageHandling [Serializable] public class PublishException : Exception { - public PublishException(): base("Failed to publish message") + public PublishException() : base("Failed to publish message") { } diff --git a/JustSaying/AwsTools/MessageHandling/SnsTopicBase.cs b/JustSaying/AwsTools/MessageHandling/SnsTopicBase.cs index dd9ed0040..3031960a3 100644 --- a/JustSaying/AwsTools/MessageHandling/SnsTopicBase.cs +++ b/JustSaying/AwsTools/MessageHandling/SnsTopicBase.cs @@ -49,7 +49,7 @@ protected SnsTopicBase( } public abstract Task ExistsAsync(); - + public async Task PublishAsync(Message message, PublishMetadata metadata, CancellationToken cancellationToken) { var request = BuildPublishRequest(message, metadata); diff --git a/JustSaying/AwsTools/MessageHandling/SqsQueueBase.cs b/JustSaying/AwsTools/MessageHandling/SqsQueueBase.cs index d468f84e1..3351b99b9 100644 --- a/JustSaying/AwsTools/MessageHandling/SqsQueueBase.cs +++ b/JustSaying/AwsTools/MessageHandling/SqsQueueBase.cs @@ -43,8 +43,8 @@ public virtual async Task DeleteAsync() if (exists) { var request = new DeleteQueueRequest - { - QueueUrl = Uri.AbsoluteUri + { + QueueUrl = Uri.AbsoluteUri }; await Client.DeleteQueueAsync(request).ConfigureAwait(false); @@ -79,10 +79,10 @@ protected async Task SetQueuePropertiesAsync() protected async Task GetAttrsAsync(IEnumerable attrKeys) { var request = new GetQueueAttributesRequest - { - QueueUrl = Uri.AbsoluteUri, - AttributeNames = new List(attrKeys) - }; + { + QueueUrl = Uri.AbsoluteUri, + AttributeNames = new List(attrKeys) + }; return await Client.GetQueueAttributesAsync(request).ConfigureAwait(false); } diff --git a/JustSaying/AwsTools/MessageHandling/SqsQueueByName.cs b/JustSaying/AwsTools/MessageHandling/SqsQueueByName.cs index 7c6df1a28..9bb33ce42 100644 --- a/JustSaying/AwsTools/MessageHandling/SqsQueueByName.cs +++ b/JustSaying/AwsTools/MessageHandling/SqsQueueByName.cs @@ -30,10 +30,10 @@ public override async Task CreateAsync(SqsBasicConfiguration queueConfig, if (!exisits) { await ErrorQueue.CreateAsync(new SqsBasicConfiguration - { - ErrorQueueRetentionPeriod = queueConfig.ErrorQueueRetentionPeriod, - ErrorQueueOptOut = true - }).ConfigureAwait(false); + { + ErrorQueueRetentionPeriod = queueConfig.ErrorQueueRetentionPeriod, + ErrorQueueOptOut = true + }).ConfigureAwait(false); } } diff --git a/JustSaying/AwsTools/QueueCreation/ConfigurationErrorsException.cs b/JustSaying/AwsTools/QueueCreation/ConfigurationErrorsException.cs index 353284b95..377ef3104 100644 --- a/JustSaying/AwsTools/QueueCreation/ConfigurationErrorsException.cs +++ b/JustSaying/AwsTools/QueueCreation/ConfigurationErrorsException.cs @@ -18,7 +18,7 @@ public ConfigurationErrorsException(string message, Exception inner) : base(mess { } - protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context): base(info, context) + protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : base(info, context) { } } diff --git a/JustSaying/AwsTools/QueueCreation/ServerSideEncryption.cs b/JustSaying/AwsTools/QueueCreation/ServerSideEncryption.cs index c4353f89c..eb454b9f3 100644 --- a/JustSaying/AwsTools/QueueCreation/ServerSideEncryption.cs +++ b/JustSaying/AwsTools/QueueCreation/ServerSideEncryption.cs @@ -9,11 +9,11 @@ public ServerSideEncryption() KmsMasterKeyId = JustSayingConstants.DefaultAttributeEncryptionKeyId; KmsDataKeyReusePeriodSeconds = JustSayingConstants.DefaultAttributeEncryptionKeyReusePeriodSecond; } - + [JsonProperty(PropertyName = "kmsMasterKeyId")] - public string KmsMasterKeyId { get; set; } + public string KmsMasterKeyId { get; set; } [JsonProperty(PropertyName = "kmsDataKeyReusePeriodSeconds")] - public string KmsDataKeyReusePeriodSeconds { get; set; } + public string KmsDataKeyReusePeriodSeconds { get; set; } } } diff --git a/JustSaying/CreateMeABus.cs b/JustSaying/CreateMeABus.cs index c688d6256..d078a8db2 100644 --- a/JustSaying/CreateMeABus.cs +++ b/JustSaying/CreateMeABus.cs @@ -13,6 +13,6 @@ public static class CreateMeABus = () => new DefaultAwsClientFactory(); public static JustSayingFluentlyDependencies WithLogging(ILoggerFactory loggerFactory) => - new JustSayingFluentlyDependencies { LoggerFactory = loggerFactory}; + new JustSayingFluentlyDependencies { LoggerFactory = loggerFactory }; } } diff --git a/JustSaying/HandlerNotRegisteredWithContainerException.cs b/JustSaying/HandlerNotRegisteredWithContainerException.cs index 67203938c..d355cfcd7 100644 --- a/JustSaying/HandlerNotRegisteredWithContainerException.cs +++ b/JustSaying/HandlerNotRegisteredWithContainerException.cs @@ -4,9 +4,9 @@ namespace JustSaying { [Serializable] - public class HandlerNotRegisteredWithContainerException: Exception + public class HandlerNotRegisteredWithContainerException : Exception { - public HandlerNotRegisteredWithContainerException(): base("Handler not registered with container") + public HandlerNotRegisteredWithContainerException() : base("Handler not registered with container") { } diff --git a/JustSaying/IPublishConfiguration.cs b/JustSaying/IPublishConfiguration.cs index 5c2d26b68..e9a548700 100644 --- a/JustSaying/IPublishConfiguration.cs +++ b/JustSaying/IPublishConfiguration.cs @@ -9,7 +9,7 @@ public interface IPublishConfiguration { int PublishFailureReAttempts { get; set; } TimeSpan PublishFailureBackoff { get; set; } - Action MessageResponseLogger { get; set;} + Action MessageResponseLogger { get; set; } IReadOnlyCollection AdditionalSubscriberAccounts { get; set; } } } diff --git a/JustSaying/JustSayingBus.cs b/JustSaying/JustSayingBus.cs index 9adc68c9a..3e9377388 100644 --- a/JustSaying/JustSayingBus.cs +++ b/JustSaying/JustSayingBus.cs @@ -64,7 +64,7 @@ public void AddNotificationSubscriber(string region, INotificationSubscriber sub if (!_subscribersByRegionAndQueue.TryGetValue(region, out var subscribersForRegion)) { - subscribersForRegion = new Dictionary(); + subscribersForRegion = new Dictionary(); _subscribersByRegionAndQueue.Add(region, subscribersForRegion); } diff --git a/JustSaying/JustSayingFluently.cs b/JustSaying/JustSayingFluently.cs index daa5f19d3..55d893266 100644 --- a/JustSaying/JustSayingFluently.cs +++ b/JustSaying/JustSayingFluently.cs @@ -128,7 +128,7 @@ public IHaveFulfilledPublishRequirements WithSqsMessagePublisher(Action(_serializationFactory.GetSerializer()); @@ -252,7 +252,7 @@ public IHaveFulfilledSubscriptionRequirements WithMessageHandler(IHandlerAsyn // TODO - Subscription listeners should be just added once per queue, // and not for each message handler - var thing = _subscriptionConfig.SubscriptionType == SubscriptionType.PointToPoint + var thing = _subscriptionConfig.SubscriptionType == SubscriptionType.PointToPoint ? PointToPointHandler() : TopicHandler(); diff --git a/JustSaying/Messaging/Interrogation/IInterrogationResponse.cs b/JustSaying/Messaging/Interrogation/IInterrogationResponse.cs index da9c2cde1..69171f73b 100644 --- a/JustSaying/Messaging/Interrogation/IInterrogationResponse.cs +++ b/JustSaying/Messaging/Interrogation/IInterrogationResponse.cs @@ -4,7 +4,7 @@ namespace JustSaying.Messaging.Interrogation { public interface IInterrogationResponse { - IEnumerable Regions { get; set; } + IEnumerable Regions { get; set; } IEnumerable Subscribers { get; set; } IEnumerable Publishers { get; set; } } diff --git a/JustSaying/Messaging/Interrogation/InterrogationResponse.cs b/JustSaying/Messaging/Interrogation/InterrogationResponse.cs index 85432405a..19a791821 100644 --- a/JustSaying/Messaging/Interrogation/InterrogationResponse.cs +++ b/JustSaying/Messaging/Interrogation/InterrogationResponse.cs @@ -11,7 +11,7 @@ public InterrogationResponse(IEnumerable regions, IEnumerable Regions { get; set; } + public IEnumerable Regions { get; set; } public IEnumerable Subscribers { get; set; } public IEnumerable Publishers { get; set; } } diff --git a/JustSaying/Messaging/MessageSerialization/NewtonsoftSerializer.cs b/JustSaying/Messaging/MessageSerialization/NewtonsoftSerializer.cs index 742e4556a..a9e349ef9 100644 --- a/JustSaying/Messaging/MessageSerialization/NewtonsoftSerializer.cs +++ b/JustSaying/Messaging/MessageSerialization/NewtonsoftSerializer.cs @@ -47,10 +47,10 @@ public string Serialize(Message message, bool serializeForSnsPublishing, string private JsonSerializerSettings GetJsonSettings() { return _settings ?? new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - Converters = new JsonConverter[] {new Newtonsoft.Json.Converters.StringEnumConverter()} - }; + { + NullValueHandling = NullValueHandling.Ignore, + Converters = new JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter() } + }; } public string GetMessageSubject(string sqsMessge)