1
0
mirror of synced 2024-11-24 09:50:11 +00:00

[ci skip] Fixed the last of the ReSharper code issues

This commit is contained in:
Mark van Renswoude 2019-08-15 16:00:04 +02:00
parent c83ca889b7
commit 196aa63a4a
16 changed files with 30 additions and 24 deletions

View File

@ -30,6 +30,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */ SOFTWARE. */
using System; using System;
// ReSharper disable InheritdocConsiderUsage
#pragma warning disable 1591 #pragma warning disable 1591
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
@ -142,7 +143,7 @@ namespace JetBrains.Annotations
/// </summary> /// </summary>
InstantiatedWithFixedConstructorSignature = 4, InstantiatedWithFixedConstructorSignature = 4,
/// <summary>Indicates implicit instantiation of a type.</summary> /// <summary>Indicates implicit instantiation of a type.</summary>
InstantiatedNoFixedConstructorSignature = 8, InstantiatedNoFixedConstructorSignature = 8
} }
/// <summary> /// <summary>

View File

@ -1,5 +1,4 @@
using System; using System.Reflection;
using System.Reflection;
using Tapeti.Config; using Tapeti.Config;
namespace Tapeti.Flow.Default namespace Tapeti.Flow.Default

View File

@ -4,6 +4,7 @@ using System.Threading.Tasks;
namespace Tapeti.Flow.Default namespace Tapeti.Flow.Default
{ {
/// <inheritdoc />
/// <summary> /// <summary>
/// Default implementation for IFlowRepository. Does not persist any state, relying on the FlowStore's cache instead. /// Default implementation for IFlowRepository. Does not persist any state, relying on the FlowStore's cache instead.
/// </summary> /// </summary>

View File

@ -27,7 +27,7 @@ namespace Tapeti.Flow.FlowHelpers
var nextLi = new LockItem(locks, key); var nextLi = new LockItem(locks, key);
try try
{ {
bool continueImmediately = false; var continueImmediately = false;
lock (locks) lock (locks)
{ {
if (!locks.TryGetValue(key, out var li)) if (!locks.TryGetValue(key, out var li))

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Tapeti.Config;
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global

View File

@ -38,6 +38,7 @@ using System;
// ReSharper disable IntroduceOptionalParameters.Global // ReSharper disable IntroduceOptionalParameters.Global
// ReSharper disable MemberCanBeProtected.Global // ReSharper disable MemberCanBeProtected.Global
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
// ReSharper disable InheritdocConsiderUsage
// ReSharper disable once CheckNamespace // ReSharper disable once CheckNamespace
namespace JetBrains.Annotations namespace JetBrains.Annotations
@ -142,7 +143,7 @@ namespace JetBrains.Annotations
/// </summary> /// </summary>
InstantiatedWithFixedConstructorSignature = 4, InstantiatedWithFixedConstructorSignature = 4,
/// <summary>Indicates implicit instantiation of a type.</summary> /// <summary>Indicates implicit instantiation of a type.</summary>
InstantiatedNoFixedConstructorSignature = 8, InstantiatedNoFixedConstructorSignature = 8
} }
/// <summary> /// <summary>

View File

@ -126,7 +126,7 @@ namespace Tapeti.Tests.Helpers
AssertConnectionString("HostName=rabbit.com;Username=\"myApplication\"", new TapetiConnectionParams AssertConnectionString("HostName=rabbit.com;Username=\"myApplication\"", new TapetiConnectionParams
{ {
HostName = "rabbit.com", HostName = "rabbit.com",
Username = "myApplication", Username = "myApplication"
}); });
} }

View File

@ -1,5 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
// ReSharper disable UnusedMember.Global
namespace Tapeti.Transient namespace Tapeti.Transient
{ {
/// <summary> /// <summary>

View File

@ -23,7 +23,7 @@ namespace Tapeti.Transient
/// <inheritdoc /> /// <inheritdoc />
public async Task<TResponse> RequestResponse<TRequest, TResponse>(TRequest request) public async Task<TResponse> RequestResponse<TRequest, TResponse>(TRequest request)
{ {
return (TResponse)(await router.RequestResponse(publisher, request)); return (TResponse)await router.RequestResponse(publisher, request);
} }
} }
} }

View File

@ -96,14 +96,13 @@ namespace Tapeti.Connection
public async Task<string> BindDynamic(Type messageClass, string queuePrefix = null) public async Task<string> BindDynamic(Type messageClass, string queuePrefix = null)
{ {
var result = await DeclareDynamicQueue(messageClass, queuePrefix); var result = await DeclareDynamicQueue(messageClass, queuePrefix);
if (!result.IsNewMessageClass)
return result.QueueName;
if (result.IsNewMessageClass) var routingKey = RoutingKeyStrategy.GetRoutingKey(messageClass);
{ var exchange = ExchangeStrategy.GetExchange(messageClass);
var routingKey = RoutingKeyStrategy.GetRoutingKey(messageClass);
var exchange = ExchangeStrategy.GetExchange(messageClass);
await ClientFactory().DynamicQueueBind(result.QueueName, new QueueBinding(exchange, routingKey)); await ClientFactory().DynamicQueueBind(result.QueueName, new QueueBinding(exchange, routingKey));
}
return result.QueueName; return result.QueueName;
} }

View File

@ -6,6 +6,7 @@ using System.Text.RegularExpressions;
namespace Tapeti.Default namespace Tapeti.Default
{ {
/// <inheritdoc />
/// <summary> /// <summary>
/// IRoutingKeyStrategy implementation which transforms the class name into a dot-separated routing key based /// IRoutingKeyStrategy implementation which transforms the class name into a dot-separated routing key based
/// on the casing. Accounts for acronyms. If the class name ends with 'Message' it is not included in the routing key. /// on the casing. Accounts for acronyms. If the class name ends with 'Message' it is not included in the routing key.

View File

@ -150,7 +150,7 @@ namespace Tapeti
Task.Run(() => Task.Run(() =>
{ {
subscriber?.ApplyBindings().ContinueWith((t) => subscriber?.ApplyBindings().ContinueWith(t =>
{ {
reconnectedEvent.Invoke(this, e); reconnectedEvent.Invoke(this, e);
}); });

View File

@ -67,12 +67,12 @@ namespace Tapeti
Port = uri.Port; Port = uri.Port;
var userInfo = uri.UserInfo.Split(':'); var userInfo = uri.UserInfo.Split(':');
if (userInfo.Length > 0) if (userInfo.Length <= 0)
{ return;
Username = userInfo[0];
if (userInfo.Length > 1) Username = userInfo[0];
Password = userInfo[1]; if (userInfo.Length > 1)
} Password = userInfo[1];
} }
} }
} }

View File

@ -29,7 +29,7 @@ namespace Test
//never true //never true
return flowProvider return flowProvider
.YieldWithRequestSync<PingConfirmationRequestMessage, PingConfirmationResponseMessage> .YieldWithRequestSync<PingConfirmationRequestMessage, PingConfirmationResponseMessage>
(new PingConfirmationRequestMessage() { StoredInState = "Ping:" }, (new PingConfirmationRequestMessage { StoredInState = "Ping:" },
HandlePingConfirmationResponse); HandlePingConfirmationResponse);
} }

View File

@ -81,7 +81,7 @@ namespace Test
.AddRequestSync<PoloConfirmationRequestMessage, PoloConfirmationResponseMessage>(new PoloConfirmationRequestMessage .AddRequestSync<PoloConfirmationRequestMessage, PoloConfirmationResponseMessage>(new PoloConfirmationRequestMessage
{ {
StoredInState = StateTestGuid, StoredInState = StateTestGuid,
EnumValue = TestEnum.Value1, EnumValue = TestEnum.Value1
}, HandlePoloConfirmationResponse1) }, HandlePoloConfirmationResponse1)
@ -124,6 +124,7 @@ namespace Test
* This will automatically include the correlationId in the response and * This will automatically include the correlationId in the response and
* use the replyTo header of the request if provided. * use the replyTo header of the request if provided.
*/ */
[DurableQueue("tapeti.test.durable")]
public async Task<PoloConfirmationResponseMessage> PoloConfirmation(PoloConfirmationRequestMessage message) public async Task<PoloConfirmationResponseMessage> PoloConfirmation(PoloConfirmationRequestMessage message)
{ {
Console.WriteLine(">> PoloConfirmation (returning confirmation)"); Console.WriteLine(">> PoloConfirmation (returning confirmation)");

View File

@ -26,6 +26,7 @@ namespace Test
.WithFlow() .WithFlow()
.WithDataAnnotations() .WithDataAnnotations()
.WithTransient(TimeSpan.FromSeconds(30)) .WithTransient(TimeSpan.FromSeconds(30))
.EnableDeclareDurableQueues()
.RegisterAllControllers() .RegisterAllControllers()
//.DisablePublisherConfirms() -> you probably never want to do this if you're using Flow or want requeues when a publish fails //.DisablePublisherConfirms() -> you probably never want to do this if you're using Flow or want requeues when a publish fails
.Build(); .Build();
@ -74,7 +75,8 @@ namespace Test
//var emitter = container.GetInstance<MarcoEmitter>(); //var emitter = container.GetInstance<MarcoEmitter>();
//emitter.Run().Wait(); //emitter.Run().Wait();
Console.WriteLine("Press any Enter to continue");
Console.ReadLine();
} }
} }
//catch (Exception e) //catch (Exception e)