Skip to content

Commit a181008

Browse files
refactor: formatting
1 parent c984074 commit a181008

33 files changed

+74
-70
lines changed

src/EntityDb.Abstractions/Commands/IAnnotatedCommand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ public interface IAnnotatedCommand<TEntity>
1212
/// The transaction id associated with the command.
1313
/// </summary>
1414
Guid TransactionId { get; }
15-
15+
1616
/// <summary>
1717
/// The transaction timestamp associated with the command.
1818
/// </summary>
1919
DateTime TransactionTimeStamp { get; }
20-
20+
2121
/// <summary>
2222
/// The entity id associated with the command.
2323
/// </summary>
2424
Guid EntityId { get; }
25-
25+
2626
/// <summary>
2727
/// The entity version number associated with the command.
2828
/// </summary>
2929
ulong EntityVersionNumber { get; }
30-
30+
3131
/// <summary>
3232
/// The command itself.
3333
/// </summary>

src/EntityDb.Abstractions/Entities/IEntityRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface IEntityRepository<TEntity> : IDisposable, IAsyncDisposable
1616
/// <param name="entityId">The id of the entity.</param>
1717
/// <returns>The most recent snapshot of a <typeparamref name="TEntity" /> or constructs a new <typeparamref name="TEntity" />.</returns>
1818
Task<TEntity?> GetSnapshotOrDefault(Guid entityId);
19-
19+
2020
/// <summary>
2121
/// Returns the current state of a <typeparamref name="TEntity" /> or constructs a new <typeparamref name="TEntity" />.
2222
/// </summary>

src/EntityDb.Abstractions/Transactions/ITransactionStep.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public interface ITransactionStep<TEntity>
1515
/// A snapshot of the entity before the command.
1616
/// </summary>
1717
TEntity PreviousEntitySnapshot { get; }
18-
18+
1919
/// <summary>
2020
/// The previous version number of the entity.
2121
/// </summary>
2222
ulong PreviousEntityVersionNumber { get; }
23-
23+
2424
/// <summary>
2525
/// A snapshot of the entity after the command.
2626
/// </summary>

src/EntityDb.Common.Tests/SnapshotTransactions/SnapshotTransactionsTestsBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using EntityDb.Abstractions.Entities;
22
using EntityDb.Abstractions.Strategies;
33
using EntityDb.Abstractions.Transactions;
4-
using EntityDb.Common.Snapshots;
54
using EntityDb.Common.Transactions;
65
using EntityDb.TestImplementations.Commands;
76
using EntityDb.TestImplementations.Entities;

src/EntityDb.Common.Tests/Snapshots/SnapshotTestsBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using EntityDb.Abstractions.Snapshots;
2-
using EntityDb.Common.Snapshots;
32
using EntityDb.TestImplementations.Entities;
43
using Shouldly;
54
using System;

src/EntityDb.Common.Tests/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void ConfigureServices(IServiceCollection serviceCollection)
2727
serviceCollection.AddAgentAccessor<DummyAgentAccessor>();
2828

2929
serviceCollection.AddEntity<TransactionEntity, TransactionEntityConstructingStrategy>();
30-
30+
3131
serviceCollection.AddLeasedEntityLeasingStrategy<TransactionEntity>();
3232
serviceCollection.AddAuthorizedEntityAuthorizingStrategy<TransactionEntity>();
3333
}

src/EntityDb.Common.Tests/Strategies/Resolving/MemberInfoNameResolvingStrategyTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public void GivenEmptyMemberInfoNameResolvingStrategy_WhenResolvingType_ThenRetu
6060

6161
var headers = new Dictionary<string, string>
6262
{
63-
[EnvelopeHelper.Platform] = EnvelopeHelper.ThisPlatform, [EnvelopeHelper.MemberInfoName] = ""
63+
[EnvelopeHelper.Platform] = EnvelopeHelper.ThisPlatform,
64+
[EnvelopeHelper.MemberInfoName] = ""
6465
};
6566

6667
// ACT

src/EntityDb.Common.Tests/TestsBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public TestsBase(IServiceProvider serviceProvider)
2424
private IServiceCollection GetParasiteServiceCollection(Type[]? omittedTypes = null)
2525
{
2626
var serviceCollection = new ServiceCollection();
27-
27+
2828
// Use reflection to get all service descriptors
29-
29+
3030
var engine = _serviceProvider.GetType()
3131
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
3232
.Single(x => x.Name == "Engine")
@@ -36,25 +36,25 @@ private IServiceCollection GetParasiteServiceCollection(Type[]? omittedTypes = n
3636
.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance)
3737
.Single(x => x.Name == "CallSiteFactory")
3838
.GetValue(engine);
39-
39+
4040
var descriptors = (callSiteFactory!.GetType()
4141
.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
4242
.Single(x => x.Name == "_descriptors")
4343
.GetValue(callSiteFactory) as List<ServiceDescriptor>)!;
44-
44+
4545
foreach (var descriptor in descriptors)
4646
{
4747
if (omittedTypes?.Contains(descriptor.ServiceType) == true)
4848
{
4949
continue;
5050
}
51-
51+
5252
serviceCollection.Add(descriptor);
5353
}
5454

5555
return serviceCollection;
5656
}
57-
57+
5858
public IServiceProvider GetServiceProviderWithOverrides(Action<IServiceCollection> configureOverrides)
5959
{
6060
var serviceCollection = GetParasiteServiceCollection();

src/EntityDb.Common.Tests/Transactions/TransactionBuilderTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class TransactionBuilderTests : TestsBase
1919
public TransactionBuilderTests(IServiceProvider serviceProvider) : base(serviceProvider)
2020
{
2121
}
22-
22+
2323
[Fact]
2424
public void GivenNoAuthorizingStrategy_WhenExecutingUnauthorizedCommand_ThenBuildSucceeds()
2525
{
@@ -30,7 +30,7 @@ public void GivenNoAuthorizingStrategy_WhenExecutingUnauthorizedCommand_ThenBuil
3030
var transactionBuilder = serviceProvider.GetRequiredService<TransactionBuilder<TransactionEntity>>();
3131

3232
var entityId = Guid.NewGuid();
33-
33+
3434
// ACT & ASSERT
3535

3636
Should.NotThrow(() => transactionBuilder
@@ -172,13 +172,13 @@ public void GivenLeasingStrategy_WhenBuildingNewEntityWithLease_ThenTransactionD
172172
// ARRANGE
173173

174174
var transactionBuilder = _serviceProvider.GetRequiredService<TransactionBuilder<TransactionEntity>>();
175-
175+
176176
// ACT
177177

178178
var transaction = transactionBuilder
179179
.Create(default, new AddLease(default!, default!, default!))
180180
.Build(default, default!);
181-
181+
182182
// ASSERT
183183

184184
transaction.Steps.Length.ShouldBe(1);
@@ -194,20 +194,20 @@ public void GivenNoLeasingStrategy_WhenBuildingNewEntityWithLease_ThenTransactio
194194
var serviceProvider = GetServiceProviderWithOmission<ILeasingStrategy<TransactionEntity>>();
195195

196196
var transactionBuilder = serviceProvider.GetRequiredService<TransactionBuilder<TransactionEntity>>();
197-
197+
198198
// ACT
199199

200200
var transaction = transactionBuilder
201201
.Create(default, new AddLease(default!, default!, default!))
202202
.Build(default, default!);
203-
203+
204204
// ASSERT
205205

206206
transaction.Steps.Length.ShouldBe(1);
207207

208208
transaction.Steps[0].Leases.Insert.ShouldBeEmpty();
209209
}
210-
210+
211211
[Fact]
212212
public async Task GivenExistingEntityId_WhenUsingEntityIdForLoadTwice_ThenLoadThrows()
213213
{
@@ -295,7 +295,7 @@ public void GivenNonExistingEntityId_WhenUsingValidVersioningStrategy_ThenVersio
295295

296296
for (ulong i = 1; i <= NumberOfVersionsToTest; i++)
297297
{
298-
transaction.Steps[(int)(i-1)].NextEntityVersionNumber.ShouldBe(i);
298+
transaction.Steps[(int)(i - 1)].NextEntityVersionNumber.ShouldBe(i);
299299
}
300300
}
301301

src/EntityDb.Common.Tests/Transactions/TransactionTestsBase.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public async Task
474474
.Setup(logger => logger.LogError(It.IsAny<VersionZeroReservedException>(), It.IsAny<string>()))
475475
.Verifiable();
476476

477-
477+
478478

479479
var transaction = TransactionSeeder.Create(1, 1, wellBehavedNextEntityVersionNumber: false);
480480

@@ -533,10 +533,10 @@ public async Task
533533
await transactionRepository.PutTransaction(secondTransaction);
534534

535535
// ASSERT
536-
536+
537537
firstTransaction.Steps.Length.ShouldBe(1);
538538
secondTransaction.Steps.Length.ShouldBe(1);
539-
539+
540540
firstTransaction.Steps[0].EntityId.ShouldBe(secondTransaction.Steps[0].EntityId);
541541
firstTransaction.Steps[0].NextEntityVersionNumber.ShouldBe(secondTransaction.Steps[0].NextEntityVersionNumber);
542542

@@ -588,7 +588,7 @@ public async Task GivenCommandInserted_WhenGettingAnnotatedCommand_ThenReturnAnn
588588
// ARRANGE
589589

590590
var transactionTimeStamp = DateTime.UtcNow;
591-
591+
592592
var expectedTransactionId = Guid.NewGuid();
593593
var expectedEntityId = Guid.NewGuid();
594594
var expectedCommand = new Count(5);
@@ -600,10 +600,10 @@ public async Task GivenCommandInserted_WhenGettingAnnotatedCommand_ThenReturnAnn
600600
// This allows for database types that cannot be more precise than milliseconds.
601601
transactionTimeStamp - TimeSpan.FromTicks(transactionTimeStamp.Ticks % TimeSpan.TicksPerMillisecond),
602602
};
603-
603+
604604
var transaction = BuildTransaction(expectedTransactionId, expectedEntityId, new NoSource(),
605605
new ICommand<TransactionEntity>[] { expectedCommand }, transactionTimeStamp);
606-
606+
607607
await using var transactionRepository = await CreateRepository("TestWrite");
608608

609609
await transactionRepository.PutTransaction(transaction);
@@ -613,7 +613,7 @@ public async Task GivenCommandInserted_WhenGettingAnnotatedCommand_ThenReturnAnn
613613
// ACT
614614

615615
var annotatedCommands = await transactionRepository.GetAnnotatedCommands(commandQuery);
616-
616+
617617
// ASSERT
618618

619619
annotatedCommands.Length.ShouldBe(1);
@@ -622,10 +622,10 @@ public async Task GivenCommandInserted_WhenGettingAnnotatedCommand_ThenReturnAnn
622622
annotatedCommands[0].EntityId.ShouldBe(expectedEntityId);
623623
annotatedCommands[0].EntityVersionNumber.ShouldBe(1ul);
624624
annotatedCommands[0].Command.ShouldBe(expectedCommand);
625-
625+
626626
expectedTransactionTimeStamps.Contains(annotatedCommands[0].TransactionTimeStamp).ShouldBeTrue();
627627
}
628-
628+
629629
[Fact]
630630
public async Task GivenEntityInserted_WhenGettingEntity_ThenReturnEntity()
631631
{

0 commit comments

Comments
 (0)