Skip to content

Commit

Permalink
Fix RC2 analyzer warnings (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
bording authored Oct 12, 2023
1 parent efe2d73 commit 79a6482
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public void Commit()

public void Rollback() => actions.Clear();

List<Action> actions = new List<Action>();
List<Action> actions = [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class FakeDispatcher : IMessageDispatcher
{
public List<(TransportOperations outgoingMessages, TransportTransaction transaction)> Dispatched = new();
public List<(TransportOperations outgoingMessages, TransportTransaction transaction)> Dispatched = [];

public Task Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction,
CancellationToken cancellationToken = new CancellationToken())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

class FakeOutboxStorage : IOutboxStorage
{
public List<(OutboxMessage outboxMessage, IOutboxTransaction transaction, ContextBag context)> Stored { get; } = new();
public List<(OutboxMessage outboxMessage, IOutboxTransaction transaction, ContextBag context)> Stored { get; } = [];
public Action<OutboxMessage, IOutboxTransaction, ContextBag> StoreCallback { get; set; } = null;

public List<FakeOutboxTransaction> StartedTransactions { get; } = new();
public List<FakeOutboxTransaction> StartedTransactions { get; } = [];

public Task<OutboxMessage> Get(string messageId, ContextBag context, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

class FakeSynchronizableStorageSession : ICompletableSynchronizedStorageSession
{
public List<(IOutboxTransaction, ContextBag)> OpenedOutboxTransactionSessions { get; } = new();
public List<ContextBag> OpenedTransactionSessions { get; set; } = new();
public List<(IOutboxTransaction, ContextBag)> OpenedOutboxTransactionSessions { get; } = [];
public List<ContextBag> OpenedTransactionSessions { get; set; } = [];
public Func<IOutboxTransaction, ContextBag, bool> TryOpenCallback { get; set; } = null;
public Action CompleteCallback { get; set; } = null;
public bool Completed { get; private set; }
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.TransactionalSession/OpenSessionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class OpenSessionOptions
/// <summary>
/// Session metadata that gets added during the session commit operation.
/// </summary>
public IDictionary<string, string> Metadata => metadata ??= new Dictionary<string, string>();
public IDictionary<string, string> Metadata => metadata ??= [];

internal bool HasMetadata => metadata != null;

Expand Down

0 comments on commit 79a6482

Please sign in to comment.