diff --git a/Driver/Program.cs b/Driver/Program.cs index ff307b0d..b8c9af85 100644 --- a/Driver/Program.cs +++ b/Driver/Program.cs @@ -19,7 +19,6 @@ namespace Driver; internal class Program { - #region Methods internal static KurrentDBClientSettings ConfigureEventStoreSettings() { KurrentDBClientSettings settings = new(); @@ -83,5 +82,4 @@ private static async Task SubscriptionsTest() { concurrentSubscriptions.StartAsync(CancellationToken.None).Wait(); } - #endregion } diff --git a/Shared.DomainDrivenDesign/EventSourcing/DomainEventRecord.cs b/Shared.DomainDrivenDesign/EventSourcing/DomainEventRecord.cs index c4a86643..8ff83ba4 100644 --- a/Shared.DomainDrivenDesign/EventSourcing/DomainEventRecord.cs +++ b/Shared.DomainDrivenDesign/EventSourcing/DomainEventRecord.cs @@ -12,7 +12,6 @@ public DomainEvent(Guid aggregateId, this.EventType = DomainHelper.GetEventTypeName(this.GetType()); } - #region Properties public Guid AggregateId { get; init; } @@ -26,5 +25,4 @@ public DomainEvent(Guid aggregateId, public String EventType { get; init; } - #endregion } \ No newline at end of file diff --git a/Shared.DomainDrivenDesign/EventSourcing/DomainHelper.cs b/Shared.DomainDrivenDesign/EventSourcing/DomainHelper.cs index b97c7305..f410c6a1 100644 --- a/Shared.DomainDrivenDesign/EventSourcing/DomainHelper.cs +++ b/Shared.DomainDrivenDesign/EventSourcing/DomainHelper.cs @@ -7,7 +7,6 @@ /// public static class DomainHelper { - #region Methods /// /// Gets the name of the event type. @@ -19,5 +18,4 @@ internal static String GetEventTypeName(Type type) return type.Name; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs b/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs index b78ab490..363b074a 100644 --- a/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs +++ b/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs @@ -13,7 +13,6 @@ namespace Shared.EventStore.Tests; public class SubscriptionRepositoryTests { - #region Methods [Fact] public async Task SubscriptionRepository_GetSubscriptions_ReturnsSubscriptions() @@ -67,5 +66,4 @@ public async Task SubscriptionRepository_GetSubscriptions_FiltersInvalidSubscrip second.PersistentSubscriptionInfo[0].GroupName.ShouldBe("Group-A"); } - #endregion } diff --git a/Shared.EventStore.Tests/SubscriptionWorkerHelperTests.cs b/Shared.EventStore.Tests/SubscriptionWorkerHelperTests.cs index ec4da9f9..87a6d894 100644 --- a/Shared.EventStore.Tests/SubscriptionWorkerHelperTests.cs +++ b/Shared.EventStore.Tests/SubscriptionWorkerHelperTests.cs @@ -13,22 +13,17 @@ namespace Shared.EventStore.Tests; public class SubscriptionWorkerHelperTests { - #region Fields private readonly IDomainEventHandlerResolverImposter domainEventHandlerResolver; - #endregion - #region Constructors public SubscriptionWorkerHelperTests() { domainEventHandlerResolver = new(); } - #endregion - #region Methods [Fact] public void SubscriptionWorkerHelper_GetNewSubscriptions_SubscriptionsReturned() @@ -188,5 +183,4 @@ public void SubscriptionWorkerHelper_TryCreatePersistentSubscriptionDetails_Vali validationError.ShouldBeNull(); } - #endregion } diff --git a/Shared.EventStore.Tests/TestObjects/EstateCreatedEvent.cs b/Shared.EventStore.Tests/TestObjects/EstateCreatedEvent.cs index 8927bede..f2199f26 100644 --- a/Shared.EventStore.Tests/TestObjects/EstateCreatedEvent.cs +++ b/Shared.EventStore.Tests/TestObjects/EstateCreatedEvent.cs @@ -5,7 +5,6 @@ namespace Shared.EventStore.Tests.TestObjects; public record EstateCreatedEvent : DomainEvent { - #region Constructors /// /// Initializes a new instance of the class. @@ -19,9 +18,7 @@ public EstateCreatedEvent(Guid aggregateId, EstateName = estateName; } - #endregion - #region Properties /// /// Gets the estate identifier. @@ -39,5 +36,4 @@ public EstateCreatedEvent(Guid aggregateId, /// public string EstateName { get; init; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore.Tests/TestObjects/TestData.cs b/Shared.EventStore.Tests/TestObjects/TestData.cs index b7556e6b..44f670fe 100644 --- a/Shared.EventStore.Tests/TestObjects/TestData.cs +++ b/Shared.EventStore.Tests/TestObjects/TestData.cs @@ -12,7 +12,6 @@ namespace Shared.EventStore.Tests.TestObjects; public class TestData { - #region Methods public static readonly Guid AggregateId = Guid.Parse("103B335B-540A-4985-BB80-FD9B2BABF866"); public static readonly Guid EventId = Guid.Parse("C9416757-582C-4F67-A320-80FE1E937045"); @@ -120,5 +119,4 @@ public static List GetPersistentSubscriptions_DemoEs return list; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/Aggregate.cs b/Shared.EventStore/Aggregate/Aggregate.cs index ec4d732d..e81905de 100644 --- a/Shared.EventStore/Aggregate/Aggregate.cs +++ b/Shared.EventStore/Aggregate/Aggregate.cs @@ -9,7 +9,6 @@ /// public abstract record Aggregate { - #region Constructors /// /// Initializes a new instance of the class. @@ -20,9 +19,7 @@ protected Aggregate() { this.Version = -1L; } - #endregion - #region Properties /// /// Gets or sets the aggregate identifier. @@ -64,9 +61,7 @@ protected Aggregate() { /// internal IList PendingEvents { get; set; } - #endregion - #region Methods /// /// Applies the and append. @@ -101,5 +96,4 @@ public Object GetAggregateMetadata() { protected abstract Object GetMetadata(); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/AggregateExtensions.cs b/Shared.EventStore/Aggregate/AggregateExtensions.cs index c6999bf3..a3378583 100644 --- a/Shared.EventStore/Aggregate/AggregateExtensions.cs +++ b/Shared.EventStore/Aggregate/AggregateExtensions.cs @@ -7,7 +7,6 @@ public static class AggregateExtensions { - #region Methods /// /// Applies the specified historic event. @@ -72,5 +71,4 @@ internal static Boolean IsEventDuplicate(this Aggregate aggregate, return aggregate.EventHistory.ContainsKey(eventId) || aggregate.PendingEvents.Any(x => x.EventId == eventId); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/AggregateRepository.cs b/Shared.EventStore/Aggregate/AggregateRepository.cs index 628d5fe0..d988bc31 100644 --- a/Shared.EventStore/Aggregate/AggregateRepository.cs +++ b/Shared.EventStore/Aggregate/AggregateRepository.cs @@ -19,7 +19,6 @@ namespace Shared.EventStore.Aggregate; public sealed class AggregateRepository : StandardTraceHandler, IAggregateRepository where TAggregate : Aggregate, new() where TDomainEvent : IDomainEvent { - #region Fields /// /// The convert to event @@ -28,9 +27,7 @@ namespace Shared.EventStore.Aggregate; private readonly IDomainEventFactory DomainEventFactory; - #endregion - #region Constructors public AggregateRepository(IEventStoreContext eventStoreContext, IDomainEventFactory domainEventFactory) { @@ -38,9 +35,7 @@ public AggregateRepository(IEventStoreContext eventStoreContext, IDomainEventFac DomainEventFactory = domainEventFactory; } - #endregion - #region Methods public async Task> GetLatestVersion(Guid aggregateId, CancellationToken cancellationToken) @@ -145,5 +140,4 @@ private Result ProcessEvents(TAggregate aggregate, return Result.Success(aggregate); } - #endregion } diff --git a/Shared.EventStore/Aggregate/AggregateRepositoryManager.cs b/Shared.EventStore/Aggregate/AggregateRepositoryManager.cs index 1931ba3d..10772333 100644 --- a/Shared.EventStore/Aggregate/AggregateRepositoryManager.cs +++ b/Shared.EventStore/Aggregate/AggregateRepositoryManager.cs @@ -6,7 +6,6 @@ public class AggregateRepositoryManager : IAggregateRepositoryManager { - #region Fields /// /// The event store context manager @@ -15,9 +14,7 @@ public class AggregateRepositoryManager : IAggregateRepositoryManager private readonly IDomainEventFactory DomainEventFactory; - #endregion - #region Constructors /// /// Initializes a new instance of the class. @@ -29,9 +26,7 @@ public AggregateRepositoryManager(IEventStoreContextManager eventStoreContextMan DomainEventFactory = domainEventFactory; } - #endregion - #region Methods /// /// Gets the aggregate repository. @@ -47,5 +42,4 @@ public AggregateRepositoryManager(IEventStoreContextManager eventStoreContextMan return new AggregateRepository(context, DomainEventFactory); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/IAggregateRepository.cs b/Shared.EventStore/Aggregate/IAggregateRepository.cs index afee97a2..73212b22 100644 --- a/Shared.EventStore/Aggregate/IAggregateRepository.cs +++ b/Shared.EventStore/Aggregate/IAggregateRepository.cs @@ -10,7 +10,6 @@ namespace Shared.EventStore.Aggregate; public interface IAggregateRepository where TAggregate : Aggregate where TDomainEvent : IDomainEvent { - #region Methods Task> GetLatestVersion(Guid aggregateId, CancellationToken cancellationToken); @@ -20,5 +19,4 @@ Task SaveChanges(TAggregate aggregate, Task> GetLatestVersionFromLastEvent(Guid aggregateId, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/IAggregateRepositoryManager.cs b/Shared.EventStore/Aggregate/IAggregateRepositoryManager.cs index 65704044..26b20f74 100644 --- a/Shared.EventStore/Aggregate/IAggregateRepositoryManager.cs +++ b/Shared.EventStore/Aggregate/IAggregateRepositoryManager.cs @@ -5,7 +5,6 @@ public interface IAggregateRepositoryManager { - #region Methods /// /// Gets the aggregate repository. @@ -17,5 +16,4 @@ public interface IAggregateRepositoryManager where TDomainEvent : IDomainEvent; - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/IDomainEventFactory.cs b/Shared.EventStore/Aggregate/IDomainEventFactory.cs index 1d5bfb3a..77e39f7e 100644 --- a/Shared.EventStore/Aggregate/IDomainEventFactory.cs +++ b/Shared.EventStore/Aggregate/IDomainEventFactory.cs @@ -13,7 +13,6 @@ namespace Shared.EventStore.Aggregate; /// The type of the domain event. public interface IDomainEventFactory where TDomainEvent : IDomainEvent { - #region Methods /// /// Creates the agge aggregate snapshot. @@ -42,5 +41,4 @@ TDomainEvent CreateDomainEvent(String json, TDomainEvent[] CreateDomainEvents(Guid aggregateId, IList @event); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/IEventDataFactory.cs b/Shared.EventStore/Aggregate/IEventDataFactory.cs index 7d322d86..58a3986a 100644 --- a/Shared.EventStore/Aggregate/IEventDataFactory.cs +++ b/Shared.EventStore/Aggregate/IEventDataFactory.cs @@ -11,7 +11,6 @@ namespace Shared.EventStore.Aggregate; /// public interface IEventDataFactory { - #region Methods /// /// Creates the event data. @@ -27,5 +26,4 @@ public interface IEventDataFactory /// EventData[] CreateEventDataList(IList domainEvents); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/ResolvedEventExtensions.cs b/Shared.EventStore/Aggregate/ResolvedEventExtensions.cs index f149032f..cbd0014c 100644 --- a/Shared.EventStore/Aggregate/ResolvedEventExtensions.cs +++ b/Shared.EventStore/Aggregate/ResolvedEventExtensions.cs @@ -12,7 +12,6 @@ namespace Shared.EventStore.Aggregate; /// public static class ResolvedEventExtensions { - #region Methods /// /// Gets the resolved event data as string. @@ -24,5 +23,4 @@ public static String GetResolvedEventDataAsString(this ResolvedEvent resolvedEve return Encoding.Default.GetString(resolvedEvent.Event.Data.ToArray(), 0, resolvedEvent.Event.Data.Length); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Aggregate/TypeMapConvertor.cs b/Shared.EventStore/Aggregate/TypeMapConvertor.cs index a1d551c4..55bf427c 100644 --- a/Shared.EventStore/Aggregate/TypeMapConvertor.cs +++ b/Shared.EventStore/Aggregate/TypeMapConvertor.cs @@ -14,7 +14,6 @@ namespace Shared.EventStore.Aggregate; /// public static class TypeMapConvertor { - #region Fields /// /// The domain event record factory @@ -23,9 +22,7 @@ public static class TypeMapConvertor private static IDomainEventFactory OverrideDomainEventFactory = null; - #endregion - #region Methods public static IDomainEvent Convertor(IDomainEventFactory overrideFactory, Guid aggregateId, ResolvedEvent @event) { @@ -97,5 +94,4 @@ private static IDomainEvent GetDomainEvent(Guid aggregateId, return TypeMapConvertor.StandardDomainEventFactory.CreateDomainEvent(aggregateId, @event); } - #endregion } diff --git a/Shared.EventStore/Aggregate/TypeProvider.cs b/Shared.EventStore/Aggregate/TypeProvider.cs index 1d2e1fca..57a661cb 100644 --- a/Shared.EventStore/Aggregate/TypeProvider.cs +++ b/Shared.EventStore/Aggregate/TypeProvider.cs @@ -13,7 +13,6 @@ /// public static class TypeProvider { - #region Methods public static void LoadDomainEventsTypeDynamically(Assembly[] assemblies) { @@ -37,5 +36,4 @@ public static void LoadDomainEventsTypeDynamically(Assembly[] assemblies) public static void LoadDomainEventsTypeDynamically() => LoadDomainEventsTypeDynamically(null); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/EventHandling/DomainEventHandlerResolver.cs b/Shared.EventStore/EventHandling/DomainEventHandlerResolver.cs index 3b8694ff..383b47d4 100644 --- a/Shared.EventStore/EventHandling/DomainEventHandlerResolver.cs +++ b/Shared.EventStore/EventHandling/DomainEventHandlerResolver.cs @@ -9,7 +9,6 @@ namespace Shared.EventStore.EventHandling; public class DomainEventHandlerResolver : IDomainEventHandlerResolver { - #region Fields /// /// The domain event handlers @@ -21,9 +20,7 @@ public class DomainEventHandlerResolver : IDomainEventHandlerResolver /// private readonly Dictionary EventHandlerConfiguration; - #endregion - #region Constructors /// /// Initializes a new instance of the class. @@ -51,9 +48,7 @@ public DomainEventHandlerResolver(Dictionary eventHandlerConfi } } - #endregion - #region Methods /// /// Gets the domain event handlers. @@ -90,5 +85,4 @@ public Result> GetDomainEventHandlers(IDomainEvent dom return Result.Success(handlersToReturn); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/EventHandling/IDomainEventHandler.cs b/Shared.EventStore/EventHandling/IDomainEventHandler.cs index 3d85bf65..53121027 100644 --- a/Shared.EventStore/EventHandling/IDomainEventHandler.cs +++ b/Shared.EventStore/EventHandling/IDomainEventHandler.cs @@ -8,7 +8,6 @@ namespace Shared.EventStore.EventHandling; public interface IDomainEventHandler { - #region Methods /// /// Handles the specified domain event. @@ -19,5 +18,4 @@ public interface IDomainEventHandler Task Handle(IDomainEvent domainEvent, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/EventStore/EventStoreConnectionSettings.cs b/Shared.EventStore/EventStore/EventStoreConnectionSettings.cs index e59e467c..1f39d20a 100644 --- a/Shared.EventStore/EventStore/EventStoreConnectionSettings.cs +++ b/Shared.EventStore/EventStore/EventStoreConnectionSettings.cs @@ -6,7 +6,6 @@ [ExcludeFromCodeCoverage] public class EventStoreConnectionSettings { - #region Public Properties public String ConnectionString { get; set; } @@ -20,9 +19,7 @@ public class EventStoreConnectionSettings public String Password { get; set; } - #endregion - #region Constructors public EventStoreConnectionSettings() { @@ -38,11 +35,8 @@ private EventStoreConnectionSettings(String connectionString, Int32 httpPort) this.HttpPort = httpPort; } - #endregion - #region Public Methods - #region public static EventStoreConnectionSettings Create() public static EventStoreConnectionSettings Create(String connectionString, Int32 httpPort) { @@ -53,11 +47,8 @@ public static EventStoreConnectionSettings Create(String connectionString) { return new EventStoreConnectionSettings(connectionString, 2113); } - #endregion - #endregion - #region Private Methods private void ParseConnectionString(String connectionString) { @@ -125,5 +116,4 @@ private void ParseConnectionString(String connectionString) this.UserName = splitUserDetails[0]; this.Password = splitUserDetails[1]; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/EventStore/EventStoreConnectionStringHealthCheck.cs b/Shared.EventStore/EventStore/EventStoreConnectionStringHealthCheck.cs index ce2edcc4..56427e3b 100644 --- a/Shared.EventStore/EventStore/EventStoreConnectionStringHealthCheck.cs +++ b/Shared.EventStore/EventStore/EventStoreConnectionStringHealthCheck.cs @@ -18,7 +18,6 @@ namespace Shared.EventStore.EventStore; /// public class EventStoreConnectionStringHealthCheck : IHealthCheck { - #region Fields /// /// The event store client settings @@ -32,9 +31,7 @@ public class EventStoreConnectionStringHealthCheck : IHealthCheck private readonly IEventStoreContext Context; - #endregion - #region Constructors /// /// Initializes a new instance of the class. @@ -57,9 +54,7 @@ internal EventStoreConnectionStringHealthCheck(IEventStoreContext context) { this.Context = context; } - #endregion - #region Methods /// /// Runs the health check, returning the status of the component being checked. @@ -90,5 +85,4 @@ public async Task CheckHealthAsync(HealthCheckContext context } } - #endregion } diff --git a/Shared.EventStore/EventStore/EventStoreContext.cs b/Shared.EventStore/EventStore/EventStoreContext.cs index 70fd32d7..74dfa0e7 100644 --- a/Shared.EventStore/EventStore/EventStoreContext.cs +++ b/Shared.EventStore/EventStore/EventStoreContext.cs @@ -25,7 +25,6 @@ public delegate void TraceHandler(String trace, [ExcludeFromCodeCoverage(Justification = "This testing is handled with a suite of integration tests")] public class EventStoreContext : IEventStoreContext { - #region Fields /// /// The event store client @@ -44,9 +43,7 @@ public class EventStoreContext : IEventStoreContext private readonly TimeSpan? Deadline; - #endregion - #region Constructors public EventStoreContext(KurrentDBClient eventStoreClient, KurrentDBProjectionManagementClient projectionManagementClient, TimeSpan? deadline = null) { @@ -61,15 +58,11 @@ public EventStoreContext(KurrentDBClientSettings clientSettings, TimeSpan? deadl this.Deadline = deadline; } - #endregion - #region Events public event TraceHandler TraceGenerated; - #endregion - #region Methods private async Task UseClientAsync(Func> action) { @@ -331,7 +324,7 @@ public async Task> RunTransientQuery(String query, CancellationTo { await EventStoreGrpcRetryPolicy.ExecuteAsync(() => this.UseProjectionManagementClientAsync(client => - client.CreateTransientAsync(queryName, query, cancellationToken: source.Token)), + client.CreateContinuousAsync(queryName, query, false, cancellationToken: source.Token)), nameof(this.RunTransientQuery), $"transient query {queryName}", this.LogRetry); while (true) @@ -352,7 +345,7 @@ await this.UseProjectionManagementClientAsync(client => return Result.Failure($"Projection {projectionDetails.Name} Status is Faulted"); // We need to wait until the query has been run before we continue. - if (status == ProjectionRunningStatus.Completed) + if (status == ProjectionRunningStatus.Completed || projectionDetails.Progress >= 100) { JsonDocument jsonDocument = await EventStoreGrpcRetryPolicy.ExecuteAsync(async () => await this.UseProjectionManagementClientAsync(client => @@ -378,10 +371,17 @@ await this.UseProjectionManagementClientAsync(client => } finally { - await EventStoreGrpcRetryPolicy.ExecuteAsync(() => - this.UseProjectionManagementClientAsync(client => - client.DisableAsync(queryName, deadline: this.Deadline, cancellationToken: cancellationToken)), - nameof(this.RunTransientQuery), $"transient query {queryName}", this.LogRetry); + try + { + await EventStoreGrpcRetryPolicy.ExecuteAsync(() => + this.UseProjectionManagementClientAsync(client => + client.DisableAsync(queryName, deadline: this.Deadline, cancellationToken: cancellationToken)), + nameof(this.RunTransientQuery), $"transient query {queryName}", this.LogRetry); + } + catch (RpcException rex) when (rex.StatusCode == StatusCode.NotFound) + { + // KurrentDB may remove completed or faulted transient projections before cleanup runs. + } } } @@ -448,5 +448,4 @@ private void LogWarning(String trace) } } - #endregion } diff --git a/Shared.EventStore/EventStore/IEventStoreContext.cs b/Shared.EventStore/EventStore/IEventStoreContext.cs index 9ab0146d..72a1bc9a 100644 --- a/Shared.EventStore/EventStore/IEventStoreContext.cs +++ b/Shared.EventStore/EventStore/IEventStoreContext.cs @@ -9,16 +9,13 @@ namespace Shared.EventStore.EventStore; using System.Threading.Tasks; public interface IEventStoreContext{ - #region Events /// /// Occurs when trace is generated /// event TraceHandler TraceGenerated; - #endregion - #region Methods Task>> GetEventsBackward(String streamName, Int32 maxNumberOfEventsToRetrieve, @@ -58,5 +55,4 @@ Task>> ReadLastEventsFromAll(Int64 numberEvents, Task> RunTransientQuery(String query, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Extensions/EventStoreHealthCheckBuilderExtensions.cs b/Shared.EventStore/Extensions/EventStoreHealthCheckBuilderExtensions.cs index 3c79b108..d17cedc9 100644 --- a/Shared.EventStore/Extensions/EventStoreHealthCheckBuilderExtensions.cs +++ b/Shared.EventStore/Extensions/EventStoreHealthCheckBuilderExtensions.cs @@ -14,7 +14,6 @@ namespace Shared.EventStore.Extensions; /// public static class EventStoreHealthCheckBuilderExtensions { - #region Methods /// /// Add a health check for EventStore services. @@ -42,14 +41,11 @@ public static IHealthChecksBuilder AddEventStore(this IHealthChecksBuilder build tags)); } - #endregion - #region Others /// /// The name /// private const String NAME = "eventstore"; - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Extensions/IApplicationBuilderExtenstions.cs b/Shared.EventStore/Extensions/IApplicationBuilderExtenstions.cs index b142180e..81cb1c99 100644 --- a/Shared.EventStore/Extensions/IApplicationBuilderExtenstions.cs +++ b/Shared.EventStore/Extensions/IApplicationBuilderExtenstions.cs @@ -17,7 +17,6 @@ public static class IApplicationBuilderExtensions { - #region Methods [ExcludeFromCodeCoverage(Justification = "Cant test with coverage as has thread inside")] public static async Task ConfigureSubscriptionService(this IApplicationBuilder applicationBuilder, @@ -157,6 +156,5 @@ private static SubscriptionWorker ConfigureSubscriptionWorker(ISubscriptionRepos - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Extensions/SubscriptionWorkerConfig.cs b/Shared.EventStore/Extensions/SubscriptionWorkerConfig.cs index 185b8100..7502af37 100644 --- a/Shared.EventStore/Extensions/SubscriptionWorkerConfig.cs +++ b/Shared.EventStore/Extensions/SubscriptionWorkerConfig.cs @@ -6,7 +6,6 @@ [ExcludeFromCodeCoverage] public class SubscriptionWorkerConfig { - #region Properties public Boolean Enabled { get; set; } @@ -27,5 +26,4 @@ public class SubscriptionWorkerConfig public String WorkerName { get; set; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/Extensions/SubscriptionWorkersRoot.cs b/Shared.EventStore/Extensions/SubscriptionWorkersRoot.cs index 33be6696..a0fd04fc 100644 --- a/Shared.EventStore/Extensions/SubscriptionWorkersRoot.cs +++ b/Shared.EventStore/Extensions/SubscriptionWorkersRoot.cs @@ -7,7 +7,6 @@ [ExcludeFromCodeCoverage] public class SubscriptionWorkersRoot { - #region Properties public Boolean InternalSubscriptionService { get; set; } @@ -17,5 +16,4 @@ public class SubscriptionWorkersRoot public List SubscriptionWorkers { get; set; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/ProjectionEngine/IProjection.cs b/Shared.EventStore/ProjectionEngine/IProjection.cs index a2fe3d3b..a635c9e0 100644 --- a/Shared.EventStore/ProjectionEngine/IProjection.cs +++ b/Shared.EventStore/ProjectionEngine/IProjection.cs @@ -7,12 +7,10 @@ using DomainDrivenDesign.EventSourcing; public interface IProjection where TState : State{ - #region Methods [Pure] Task Handle(TState state, IDomainEvent domainEvent, CancellationToken cancellationToken); Boolean ShouldIHandleEvent(IDomainEvent domainEvent); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/ProjectionEngine/IProjectionHandler.cs b/Shared.EventStore/ProjectionEngine/IProjectionHandler.cs index 753927c1..59cfe283 100644 --- a/Shared.EventStore/ProjectionEngine/IProjectionHandler.cs +++ b/Shared.EventStore/ProjectionEngine/IProjectionHandler.cs @@ -6,15 +6,11 @@ using DomainDrivenDesign.EventSourcing; public interface IProjectionHandler{ - #region Events event EventHandler TraceGenerated; - #endregion - #region Methods Task Handle(IDomainEvent @event, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/ProjectionEngine/IProjectionStateRepository.cs b/Shared.EventStore/ProjectionEngine/IProjectionStateRepository.cs index f5cb8435..96715c21 100644 --- a/Shared.EventStore/ProjectionEngine/IProjectionStateRepository.cs +++ b/Shared.EventStore/ProjectionEngine/IProjectionStateRepository.cs @@ -6,7 +6,6 @@ using DomainDrivenDesign.EventSourcing; public interface IProjectionStateRepository where TState : State{ - #region Methods Task Load(IDomainEvent @event, CancellationToken cancellationToken); @@ -14,5 +13,4 @@ public interface IProjectionStateRepository where TState : State{ Task Save(TState state, IDomainEvent @event, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/ProjectionEngine/IStateDispatcher.cs b/Shared.EventStore/ProjectionEngine/IStateDispatcher.cs index 9e9ef79e..b7c84c26 100644 --- a/Shared.EventStore/ProjectionEngine/IStateDispatcher.cs +++ b/Shared.EventStore/ProjectionEngine/IStateDispatcher.cs @@ -5,9 +5,7 @@ using DomainDrivenDesign.EventSourcing; public interface IStateDispatcher where TState : State{ - #region Methods Task Dispatch(TState state, IDomainEvent @event, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/ProjectionEngine/ProjectionHandler.cs b/Shared.EventStore/ProjectionEngine/ProjectionHandler.cs index 1239e861..d4b2dd7f 100644 --- a/Shared.EventStore/ProjectionEngine/ProjectionHandler.cs +++ b/Shared.EventStore/ProjectionEngine/ProjectionHandler.cs @@ -8,7 +8,6 @@ using DomainDrivenDesign.EventSourcing; public class ProjectionHandler : IProjectionHandler where TState : State{ - #region Fields private readonly IProjection Projection; @@ -16,9 +15,7 @@ public class ProjectionHandler : IProjectionHandler where TState : State private readonly IStateDispatcher StateDispatcher; - #endregion - #region Constructors public ProjectionHandler(IProjectionStateRepository projectionStateRepository, IProjection projection, @@ -28,15 +25,11 @@ public ProjectionHandler(IProjectionStateRepository projectionStateRepos this.StateDispatcher = stateDispatcher; } - #endregion - #region Events public event EventHandler TraceGenerated; - #endregion - #region Methods public async Task Handle(IDomainEvent @event, CancellationToken cancellationToken){ if (@event == null) return; @@ -94,5 +87,4 @@ private void Trace(String traceMessage){ this.TraceGenerated(this, traceMessage ); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/ProjectionEngine/State.cs b/Shared.EventStore/ProjectionEngine/State.cs index 0a2283d2..c0ec0b4d 100644 --- a/Shared.EventStore/ProjectionEngine/State.cs +++ b/Shared.EventStore/ProjectionEngine/State.cs @@ -5,12 +5,10 @@ [ExcludeFromCodeCoverage] public record State{ - #region Properties public Boolean ChangesApplied{ get; init; } public Boolean IsInitialised => this.Version != null; public Boolean IsNotInitialised => this.Version == null; public Byte[] Version{ get; init; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/SubscriptionWorker/EventDispatchHelper.cs b/Shared.EventStore/SubscriptionWorker/EventDispatchHelper.cs index e08dcd35..3d233987 100644 --- a/Shared.EventStore/SubscriptionWorker/EventDispatchHelper.cs +++ b/Shared.EventStore/SubscriptionWorker/EventDispatchHelper.cs @@ -15,7 +15,6 @@ namespace Shared.EventStore.SubscriptionWorker; [ExcludeFromCodeCoverage] public static class EventDispatchHelper { - #region Methods /// /// Dispatches to handlers. @@ -59,5 +58,4 @@ public static async Task DispatchToHandlers(this IDomainEvent @event, return Result.Success(); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/SubscriptionWorker/EventStorePersistentSubscriptionsClient.cs b/Shared.EventStore/SubscriptionWorker/EventStorePersistentSubscriptionsClient.cs index 8dc2ded6..bf23e222 100644 --- a/Shared.EventStore/SubscriptionWorker/EventStorePersistentSubscriptionsClient.cs +++ b/Shared.EventStore/SubscriptionWorker/EventStorePersistentSubscriptionsClient.cs @@ -11,21 +11,16 @@ namespace Shared.EventStore.SubscriptionWorker; [ExcludeFromCodeCoverage] public class EventStorePersistentSubscriptionsClient : IPersistentSubscriptionsClient { - #region Fields private readonly KurrentDBPersistentSubscriptionsClient SubscriptionsClient; - #endregion - #region Constructors public EventStorePersistentSubscriptionsClient(KurrentDBPersistentSubscriptionsClient subscriptionsClient) { this.SubscriptionsClient = subscriptionsClient; } - #endregion - #region Methods public Task SubscribeAsync(String stream, String group, @@ -39,5 +34,4 @@ public EventStorePersistentSubscriptionsClient(KurrentDBPersistentSubscriptionsC return this.SubscriptionsClient.SubscribeToStreamAsync(stream, group, eventAppeared, subscriptionDropped, userCredentials, bufferSize, cancellationToken); } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/SubscriptionWorker/IPersistentSubscriptionsClient.cs b/Shared.EventStore/SubscriptionWorker/IPersistentSubscriptionsClient.cs index f15059b3..486f9638 100644 --- a/Shared.EventStore/SubscriptionWorker/IPersistentSubscriptionsClient.cs +++ b/Shared.EventStore/SubscriptionWorker/IPersistentSubscriptionsClient.cs @@ -8,7 +8,6 @@ namespace Shared.EventStore.SubscriptionWorker; public interface IPersistentSubscriptionsClient { - #region Methods Task SubscribeAsync(String stream, String group, @@ -20,5 +19,4 @@ public interface IPersistentSubscriptionsClient Int32 bufferSize, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/SubscriptionWorker/InMemoryPersistentSubscriptionsClient.cs b/Shared.EventStore/SubscriptionWorker/InMemoryPersistentSubscriptionsClient.cs index 229ff404..e0b663af 100644 --- a/Shared.EventStore/SubscriptionWorker/InMemoryPersistentSubscriptionsClient.cs +++ b/Shared.EventStore/SubscriptionWorker/InMemoryPersistentSubscriptionsClient.cs @@ -18,7 +18,6 @@ public class InMemoryPersistentSubscriptionsClient : IPersistentSubscriptionsCli private String Stream; private String Group; - #region Methods public async Task SubscribeAsync(String stream, String group, @@ -59,5 +58,4 @@ public void WriteEvent(String @event, String @type, String customMetadata, Cance this.EventAppeared(default, re, 0, cancellationToken); } - #endregion } diff --git a/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionDetails.cs b/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionDetails.cs index fbac145d..be32a4bf 100644 --- a/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionDetails.cs +++ b/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionDetails.cs @@ -6,7 +6,6 @@ [ExcludeFromCodeCoverage] public record PersistentSubscriptionDetails { - #region Constructors public PersistentSubscriptionDetails(String streamName, String groupName) @@ -15,9 +14,7 @@ public PersistentSubscriptionDetails(String streamName, this.GroupName = groupName; } - #endregion - #region Properties public String GroupName { get; init; } @@ -25,11 +22,8 @@ public PersistentSubscriptionDetails(String streamName, public String StreamName { get; init; } - #endregion - #region Methods public override String ToString() => $"{this.StreamName}-{this.GroupName}"; - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionInfo.cs b/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionInfo.cs index 0397e5d6..2c764ec2 100644 --- a/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionInfo.cs +++ b/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionInfo.cs @@ -6,11 +6,9 @@ [ExcludeFromCodeCoverage] public class PersistentSubscriptionInfo { - #region Properties public String GroupName { get; set; } public String StreamName { get; set; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionsHelper.cs b/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionsHelper.cs index 68f56f5a..dd4f2e8b 100644 --- a/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionsHelper.cs +++ b/Shared.EventStore/SubscriptionWorker/PersistentSubscriptionsHelper.cs @@ -12,7 +12,6 @@ namespace Shared.EventStore.SubscriptionWorker; [ExcludeFromCodeCoverage] public static class PersistentSubscriptionsHelper { - #region Methods public static PersistentSubscriptions Update(this PersistentSubscriptions persistentSubscriptions, List subscriptions) { @@ -40,5 +39,4 @@ _ when resolvedEvent.Event.EventType.StartsWith("$") => true, _ => false }; - #endregion } diff --git a/Shared.EventStore/SubscriptionWorker/SubscriptionWorker.cs b/Shared.EventStore/SubscriptionWorker/SubscriptionWorker.cs index 7c9dd7fb..ae230fb6 100644 --- a/Shared.EventStore/SubscriptionWorker/SubscriptionWorker.cs +++ b/Shared.EventStore/SubscriptionWorker/SubscriptionWorker.cs @@ -15,7 +15,6 @@ namespace Shared.EventStore.SubscriptionWorker; [ExcludeFromCodeCoverage] public class SubscriptionWorker { - #region Fields internal readonly List CurrentSubscriptions = new(); @@ -37,9 +36,7 @@ public class SubscriptionWorker private readonly Action WriteWarning; - #endregion - #region Constructors private SubscriptionWorker(String eventStoreConnectionString, IDomainEventHandlerResolver domainEventHandlerResolver, @@ -68,9 +65,7 @@ private SubscriptionWorker(String eventStoreConnectionString, this.WriteError = message => SubscriptionWorkerHelper.SafeInvokeEvent(this.Error, this, message); } - #endregion - #region Properties public String IncludeGroups { get; internal set; } public String IgnoreGroups { get; internal set; } @@ -83,17 +78,13 @@ private SubscriptionWorker(String eventStoreConnectionString, public Boolean IsRunning { get; private set; } public Int32 PersistentSubscriptionPollingInSeconds { get; } - #endregion - #region Events public event EventHandler Error; public event EventHandler Trace; public event EventHandler Warning; - #endregion - #region Methods public static SubscriptionWorker CreateSubscriptionWorker(String eventStoreConnectionString, IDomainEventHandlerResolver domainEventHandlerResolver, @@ -261,5 +252,4 @@ private async void SubscriptionDropped(PersistentSubscription subscription, Stri } } - #endregion } diff --git a/Shared.EventStore/SubscriptionWorker/SubscriptionWorkerHelper.cs b/Shared.EventStore/SubscriptionWorker/SubscriptionWorkerHelper.cs index 80e9974d..2d567a9b 100644 --- a/Shared.EventStore/SubscriptionWorker/SubscriptionWorkerHelper.cs +++ b/Shared.EventStore/SubscriptionWorker/SubscriptionWorkerHelper.cs @@ -16,7 +16,6 @@ namespace Shared.EventStore.SubscriptionWorker; [ExcludeFromCodeCoverage] public static class SubscriptionWorkerHelper { - #region Methods public static void SafeInvokeEvent(EventHandler eventHandler, Object sender, @@ -241,5 +240,4 @@ public static void ConfigureTracing(this SubscriptionWorker worker, string type, worker.Error += (_, args) => traceHandler(TraceEventType.Error, type, args.Message); } - #endregion } diff --git a/Shared.EventStore/SubscriptionWorker/TraceEventArgs.cs b/Shared.EventStore/SubscriptionWorker/TraceEventArgs.cs index 4af60e84..4799553a 100644 --- a/Shared.EventStore/SubscriptionWorker/TraceEventArgs.cs +++ b/Shared.EventStore/SubscriptionWorker/TraceEventArgs.cs @@ -6,9 +6,7 @@ [ExcludeFromCodeCoverage] public class TraceEventArgs : EventArgs { - #region Properties public String Message { get; set; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStoreContext.Tests/EstateCreatedEvent.cs b/Shared.EventStoreContext.Tests/EstateCreatedEvent.cs index 0410ad05..47ccf61d 100644 --- a/Shared.EventStoreContext.Tests/EstateCreatedEvent.cs +++ b/Shared.EventStoreContext.Tests/EstateCreatedEvent.cs @@ -4,7 +4,6 @@ namespace Shared.EventStoreContext.Tests; public record EstateCreatedEvent : DomainEvent { - #region Constructors /// /// Initializes a new instance of the class. @@ -18,9 +17,7 @@ public EstateCreatedEvent(Guid aggregateId, this.EstateName = estateName; } - #endregion - #region Properties /// /// Gets the estate identifier. @@ -38,5 +35,4 @@ public EstateCreatedEvent(Guid aggregateId, /// public String EstateName { get; init; } - #endregion } \ No newline at end of file diff --git a/Shared.EventStoreContext.Tests/EventStoreContextTests.cs b/Shared.EventStoreContext.Tests/EventStoreContextTests.cs index 0b1b6330..4b0391ba 100644 --- a/Shared.EventStoreContext.Tests/EventStoreContextTests.cs +++ b/Shared.EventStoreContext.Tests/EventStoreContextTests.cs @@ -15,7 +15,6 @@ namespace Shared.EventStoreContext.Tests; public class EventStoreContextTests : IDisposable{ - #region Fields private readonly EventStoreDockerHelper EventStoreDockerHelper; @@ -37,9 +36,7 @@ public EventStoreContextTests() TypeMap.AddType("EstateCreatedEvent"); } - #endregion - #region Methods public void Dispose(){ // Just needed for the interface @@ -372,6 +369,5 @@ private void InitialiseRetryConfiguration() ConfigurationReader.Initialise(builder.Build()); } - #endregion } diff --git a/Shared.IntegrationTesting.Tests/DockerHelperTest1.feature b/Shared.IntegrationTesting.Tests/DockerHelperTest1.feature deleted file mode 100644 index 99e0e460..00000000 --- a/Shared.IntegrationTesting.Tests/DockerHelperTest1.feature +++ /dev/null @@ -1,4 +0,0 @@ -@base -Feature: DockerHelperTest1 - -Scenario: Test Container Startup Sequence 1 diff --git a/Shared.IntegrationTesting.Tests/DockerHelperTest1.feature.cs b/Shared.IntegrationTesting.Tests/DockerHelperTest1.feature.cs deleted file mode 100644 index dea515fb..00000000 --- a/Shared.IntegrationTesting.Tests/DockerHelperTest1.feature.cs +++ /dev/null @@ -1,139 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by Reqnroll (https://reqnroll.net/). -// Reqnroll Version:3.0.0.0 -// Reqnroll Generator Version:3.0.0.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -using Reqnroll; -namespace Shared.IntegrationTesting.Tests -{ - - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "3.0.0.0")] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::NUnit.Framework.TestFixtureAttribute()] - [global::NUnit.Framework.DescriptionAttribute("DockerHelperTest1")] - [global::NUnit.Framework.FixtureLifeCycleAttribute(global::NUnit.Framework.LifeCycle.InstancePerTestCase)] - [global::NUnit.Framework.CategoryAttribute("base")] - public partial class DockerHelperTest1Feature - { - - private global::Reqnroll.ITestRunner testRunner; - - private static string[] featureTags = new string[] { - "base"}; - - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "", "DockerHelperTest1", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags, InitializeCucumberMessages()); - -#line 1 "DockerHelperTest1.feature" -#line hidden - - [global::NUnit.Framework.OneTimeSetUpAttribute()] - public static async global::System.Threading.Tasks.Task FeatureSetupAsync() - { - } - - [global::NUnit.Framework.OneTimeTearDownAttribute()] - public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() - { - await global::Reqnroll.TestRunnerManager.ReleaseFeatureAsync(featureInfo); - } - - [global::NUnit.Framework.SetUpAttribute()] - public async global::System.Threading.Tasks.Task TestInitializeAsync() - { - testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - try - { - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) - { - await testRunner.OnFeatureEndAsync(); - } - } - finally - { - if (((testRunner.FeatureContext != null) - && testRunner.FeatureContext.BeforeFeatureHookFailed)) - { - throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); - } - if ((testRunner.FeatureContext == null)) - { - await testRunner.OnFeatureStartAsync(featureInfo); - } - } - } - - [global::NUnit.Framework.TearDownAttribute()] - public async global::System.Threading.Tasks.Task TestTearDownAsync() - { - if ((testRunner == null)) - { - return; - } - try - { - await testRunner.OnScenarioEndAsync(); - } - finally - { - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); - testRunner = null; - } - } - - public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, global::Reqnroll.RuleInfo ruleInfo) - { - testRunner.OnScenarioInitialize(scenarioInfo, ruleInfo); - testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(global::NUnit.Framework.TestContext.CurrentContext); - } - - public async global::System.Threading.Tasks.Task ScenarioStartAsync() - { - await testRunner.OnScenarioStartAsync(); - } - - public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() - { - await testRunner.CollectScenarioErrorsAsync(); - } - - private static global::Reqnroll.Formatters.RuntimeSupport.FeatureLevelCucumberMessages InitializeCucumberMessages() - { - return new global::Reqnroll.Formatters.RuntimeSupport.FeatureLevelCucumberMessages("DockerHelperTest1.feature.ndjson", 3); - } - - [global::NUnit.Framework.TestAttribute()] - [global::NUnit.Framework.DescriptionAttribute("Test Container Startup Sequence 1")] - public async global::System.Threading.Tasks.Task TestContainerStartupSequence1() - { - string[] tagsOfScenario = ((string[])(null)); - global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); - string pickleIndex = "0"; - global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Test Container Startup Sequence 1", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); - string[] tagsOfRule = ((string[])(null)); - global::Reqnroll.RuleInfo ruleInfo = null; -#line 4 -this.ScenarioInitialize(scenarioInfo, ruleInfo); -#line hidden - if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) - { - await testRunner.SkipScenarioAsync(); - } - else - { - await this.ScenarioStartAsync(); - } - await this.ScenarioCleanupAsync(); - } - } -} -#pragma warning restore -#endregion diff --git a/Shared.IntegrationTesting/ReqnrollTableHelper.cs b/Shared.IntegrationTesting/ReqnrollTableHelper.cs index a800a05c..30ce07ca 100644 --- a/Shared.IntegrationTesting/ReqnrollTableHelper.cs +++ b/Shared.IntegrationTesting/ReqnrollTableHelper.cs @@ -8,7 +8,6 @@ /// public static class ReqnrollTableHelper { - #region Methods public static Boolean GetBooleanValue(DataTableRow row, String key) @@ -85,5 +84,4 @@ public static T GetEnumValue(DataTableRow row, } - #endregion } \ No newline at end of file diff --git a/Shared.IntegrationTesting/Retry.cs b/Shared.IntegrationTesting/Retry.cs index 45091532..42530bb6 100644 --- a/Shared.IntegrationTesting/Retry.cs +++ b/Shared.IntegrationTesting/Retry.cs @@ -9,7 +9,6 @@ namespace Shared.IntegrationTesting; public static class Retry { - #region Fields /// /// The default retry for @@ -21,9 +20,7 @@ public static class Retry /// private static readonly TimeSpan DefaultRetryInterval = TimeSpan.FromSeconds(5); - #endregion - #region Methods /// /// Fors the specified action. @@ -105,5 +102,4 @@ public static async Task For( } } - #endregion } diff --git a/Shared.IntegrationTesting/TestContainers/BaseDockerHelper.cs b/Shared.IntegrationTesting/TestContainers/BaseDockerHelper.cs index 8a900d2a..6f76c740 100644 --- a/Shared.IntegrationTesting/TestContainers/BaseDockerHelper.cs +++ b/Shared.IntegrationTesting/TestContainers/BaseDockerHelper.cs @@ -29,7 +29,6 @@ namespace Shared.IntegrationTesting.TestContainers; using System.Threading.Tasks; public abstract class BaseDockerHelper{ - #region Fields public Boolean SkipHealthChecks; @@ -110,9 +109,7 @@ public abstract class BaseDockerHelper{ private String sqlTestConnString; - #endregion - #region Constructors protected BaseDockerHelper(Boolean skipHealthChecks=false) { this.SkipHealthChecks = skipHealthChecks; @@ -127,8 +124,8 @@ protected BaseDockerHelper(Boolean skipHealthChecks=false) { } })); - this.ImageDetails.Add(ContainerType.SqlServer, ("mcr.microsoft.com/mssql/server:2022-latest", true)); - this.ImageDetails.Add(ContainerType.EventStore, ("kurrentplatform/kurrentdb:26.1", true)); + this.ImageDetails.Add(ContainerType.SqlServer, ("mcr.microsoft.com/mssql/server:2025-latest", true)); + this.ImageDetails.Add(ContainerType.EventStore, ("kurrentplatform/kurrentdb:26.2.2", true)); this.ImageDetails.Add(ContainerType.MessagingService, ("stuartferguson/messagingservice:master", true)); this.ImageDetails.Add(ContainerType.SecurityService, ("stuartferguson/securityservice:master", true)); this.ImageDetails.Add(ContainerType.CallbackHandler, ("stuartferguson/callbackhandler:master", true)); @@ -143,15 +140,11 @@ protected BaseDockerHelper(Boolean skipHealthChecks=false) { this.HostPorts = new Dictionary(); } - #endregion - #region Properties public Boolean IsSecureEventStore{ get; protected set; } - #endregion - #region Methods public virtual Dictionary GetAdditionalVariables(ContainerType containerType){ Dictionary result = new(); @@ -1271,5 +1264,4 @@ private string RedactConnectionString(string connString) ); } - #endregion } diff --git a/Shared.Logger/ILogger.cs b/Shared.Logger/ILogger.cs index af9e986e..5594c480 100644 --- a/Shared.Logger/ILogger.cs +++ b/Shared.Logger/ILogger.cs @@ -7,7 +7,6 @@ namespace Shared.Logger; /// public interface ILogger { - #region Properties /// /// Gets or sets a value indicating whether this instance is initialised. @@ -17,9 +16,7 @@ public interface ILogger /// Boolean IsInitialised { get; set; } - #endregion - #region Methods void LogCritical(Exception exception); @@ -41,5 +38,4 @@ void LogError(String message, void LogWarning(String message); - #endregion } \ No newline at end of file diff --git a/Shared.Logger/MicrosoftLogger.cs b/Shared.Logger/MicrosoftLogger.cs index 9f5f52a3..51d2cdcf 100644 --- a/Shared.Logger/MicrosoftLogger.cs +++ b/Shared.Logger/MicrosoftLogger.cs @@ -7,19 +7,14 @@ namespace Shared.Logger; [ExcludeFromCodeCoverage] public class MicrosoftLogger : ILogger { - #region Fields private Microsoft.Extensions.Logging.ILogger LoggerObject; - #endregion - #region Properties public Boolean IsInitialised { get; set; } - #endregion - #region Methods public void Initialise(Microsoft.Extensions.Logging.ILogger loggerObject) { this.LoggerObject = loggerObject; @@ -80,5 +75,4 @@ private void LogMessage(LogLevel logLevel, } } - #endregion } \ No newline at end of file diff --git a/Shared.Logger/NlogLogger.cs b/Shared.Logger/NlogLogger.cs index 09ec0f19..fc2a0b66 100644 --- a/Shared.Logger/NlogLogger.cs +++ b/Shared.Logger/NlogLogger.cs @@ -11,21 +11,16 @@ namespace Shared.Logger; [ExcludeFromCodeCoverage] public class NlogLogger : ILogger { - #region Fields private String FileName; private NLog.Logger LoggerObject; - #endregion - #region Properties public Boolean IsInitialised { get; set; } - #endregion - #region Methods public void Initialise(NLog.Logger loggerObject, String fileName) { @@ -87,5 +82,4 @@ private void LogMessage(LogLevel logLevel, } } - #endregion } \ No newline at end of file diff --git a/Shared.Logger/NullLogger.cs b/Shared.Logger/NullLogger.cs index aae54625..2f6a788a 100644 --- a/Shared.Logger/NullLogger.cs +++ b/Shared.Logger/NullLogger.cs @@ -10,15 +10,12 @@ namespace Shared.Logger; [ExcludeFromCodeCoverage] public class NullLogger : ILogger { - #region Properties public static NullLogger Instance => new NullLogger(); public Boolean IsInitialised { get; set; } - #endregion - #region Methods public void Initialise() { this.IsInitialised = true; @@ -62,5 +59,4 @@ public void LogWarning(String message) { // This is a null logger so needs to actual implementation } - #endregion } \ No newline at end of file diff --git a/Shared.Logger/TennantContext/TenantIdentifiers.cs b/Shared.Logger/TennantContext/TenantIdentifiers.cs index 0c2b7f6e..58e0ea2b 100644 --- a/Shared.Logger/TennantContext/TenantIdentifiers.cs +++ b/Shared.Logger/TennantContext/TenantIdentifiers.cs @@ -3,12 +3,10 @@ public record TenantIdentifiers(Guid EstateId, Guid MerchantId) { - #region Methods public static TenantIdentifiers Default() { return new TenantIdentifiers(Guid.Empty, Guid.Empty); } - #endregion } \ No newline at end of file diff --git a/Shared.Logger/TennantContext/TennatContext.cs b/Shared.Logger/TennantContext/TennatContext.cs index cd127306..07631177 100644 --- a/Shared.Logger/TennantContext/TennatContext.cs +++ b/Shared.Logger/TennantContext/TennatContext.cs @@ -2,14 +2,11 @@ public class TenantContext { - #region Fields public static readonly String KeyNameCorrelationId = "correlationId"; private static readonly AsyncLocal Current = new AsyncLocal(); - #endregion - #region Properties public CorrelationId CorrelationId { get; internal set; } = CorrelationId.New(); @@ -25,5 +22,4 @@ public static TenantContext CurrentTenant public Guid MerchantId { get; internal set; } - #endregion } \ No newline at end of file diff --git a/Shared.Tests/ConfigurationRootExtensionsTests.cs b/Shared.Tests/ConfigurationRootExtensionsTests.cs index 953938e4..ad1f046f 100644 --- a/Shared.Tests/ConfigurationRootExtensionsTests.cs +++ b/Shared.Tests/ConfigurationRootExtensionsTests.cs @@ -12,7 +12,6 @@ /// public partial class SharedTests { - #region Methods /// /// Configurations the root extensions log configuration configuration is logged. @@ -77,5 +76,4 @@ public void ConfigurationRootExtensions_LogConfiguration_NullAction_ErrorIsThrow Should.Throw(() => configuration.LogConfiguration(loggerAction)); } - #endregion } diff --git a/Shared.Tests/DateTimeExtensionsTests.cs b/Shared.Tests/DateTimeExtensionsTests.cs index 3955c014..ba326054 100644 --- a/Shared.Tests/DateTimeExtensionsTests.cs +++ b/Shared.Tests/DateTimeExtensionsTests.cs @@ -7,7 +7,6 @@ public partial class SharedTests { - #region Methods [Theory] [InlineData("2022-01-12", "yyyy-MM-dd", "79fe8000-d55e-08d9-0000-000000000000")] @@ -23,5 +22,4 @@ public void DateTime_ToGuid_IsConverted(String dateTime, guid.ShouldBe(Guid.Parse(expectedGuid)); } - #endregion } \ No newline at end of file diff --git a/Shared.Tests/GuidExtensionsTests.cs b/Shared.Tests/GuidExtensionsTests.cs index da9da680..f1b19026 100644 --- a/Shared.Tests/GuidExtensionsTests.cs +++ b/Shared.Tests/GuidExtensionsTests.cs @@ -7,7 +7,6 @@ public partial class SharedTests { - #region Methods [Theory] [InlineData("79fe8000-d55e-08d9-0000-000000000000", "2022-01-12", "yyyy-MM-dd")] @@ -23,5 +22,4 @@ public void Guid_ToDateTime_IsConverted(String guid, dateTime.ShouldBe(DateTime.ParseExact(expectedDateTime, format, null)); } - #endregion } \ No newline at end of file diff --git a/Shared/Extensions/DateTimeExtensions.cs b/Shared/Extensions/DateTimeExtensions.cs index d33056c5..283e8f98 100644 --- a/Shared/Extensions/DateTimeExtensions.cs +++ b/Shared/Extensions/DateTimeExtensions.cs @@ -4,7 +4,6 @@ public static class DateTimeExtensions { - #region Methods public static Guid ToGuid(this DateTime dt) { @@ -15,5 +14,4 @@ public static Guid ToGuid(this DateTime dt) return new Guid(bytes); } - #endregion } \ No newline at end of file diff --git a/Shared/Extensions/GuidExtensions.cs b/Shared/Extensions/GuidExtensions.cs index a94869ce..e64a8b99 100644 --- a/Shared/Extensions/GuidExtensions.cs +++ b/Shared/Extensions/GuidExtensions.cs @@ -4,7 +4,6 @@ public static class GuidExtensions { - #region Methods public static DateTime ToDateTime(this Guid guid) { @@ -15,5 +14,4 @@ public static DateTime ToDateTime(this Guid guid) return new DateTime(BitConverter.ToInt64(bytes)); } - #endregion } \ No newline at end of file diff --git a/Shared/Extensions/HealthChecksBuilderExtensions.cs b/Shared/Extensions/HealthChecksBuilderExtensions.cs index 19122c35..e562990f 100644 --- a/Shared/Extensions/HealthChecksBuilderExtensions.cs +++ b/Shared/Extensions/HealthChecksBuilderExtensions.cs @@ -11,7 +11,6 @@ /// public static class HealthChecksBuilderExtensions { - #region Methods public static IHealthChecksBuilder AddFileProcessorService(this IHealthChecksBuilder builder, Func customHttpHandler = null) { @@ -63,5 +62,4 @@ public static IHealthChecksBuilder AddTransactionProcessorService(this IHealthCh configurePrimaryHttpMessageHandler: customHttpHandler); } - #endregion } \ No newline at end of file diff --git a/Shared/Extensions/HostEnvironmentExtensions.cs b/Shared/Extensions/HostEnvironmentExtensions.cs index 86d945c4..5cc31684 100644 --- a/Shared/Extensions/HostEnvironmentExtensions.cs +++ b/Shared/Extensions/HostEnvironmentExtensions.cs @@ -8,7 +8,6 @@ /// public static class HostEnvironmentExtensions { - #region Methods public static Boolean IsPreProduction(this IHostEnvironment hostEnvironment) { @@ -20,5 +19,4 @@ public static Boolean IsPreProduction(this IHostEnvironment hostEnvironment) return hostEnvironment.IsEnvironment("PreProduction"); } - #endregion } \ No newline at end of file diff --git a/Shared/General/ClaimsHelper.cs b/Shared/General/ClaimsHelper.cs index 6c25e2ed..ee968d73 100644 --- a/Shared/General/ClaimsHelper.cs +++ b/Shared/General/ClaimsHelper.cs @@ -11,7 +11,6 @@ namespace Shared.General; [ExcludeFromCodeCoverage] public static class ClaimsHelper { - #region Methods public static Result GetUserClaim(ClaimsPrincipal user, String customClaimType) => @@ -98,5 +97,4 @@ public static Boolean ValidateRouteParameter(T routeParameter, return true; } - #endregion } \ No newline at end of file diff --git a/Shared/General/GuidCalculator.cs b/Shared/General/GuidCalculator.cs index 1b5d7069..11e22cd6 100644 --- a/Shared/General/GuidCalculator.cs +++ b/Shared/General/GuidCalculator.cs @@ -6,7 +6,6 @@ [ExcludeFromCodeCoverage] public static class GuidCalculator { - #region Methods public static Guid Combine(Guid firstGuid, Guid secondGuid, @@ -53,5 +52,4 @@ public static Guid Combine(Guid firstGuid, return GuidCalculator.Combine(firstGuid, secondGuid, thirdGuid, 0); } - #endregion } \ No newline at end of file diff --git a/Shared/General/TypeMap.cs b/Shared/General/TypeMap.cs index 2bbae1de..4cba2a08 100644 --- a/Shared/General/TypeMap.cs +++ b/Shared/General/TypeMap.cs @@ -5,7 +5,6 @@ public static class TypeMap { - #region Fields /// /// The map @@ -17,9 +16,7 @@ public static class TypeMap /// public static readonly Dictionary ReverseMap = new(); - #endregion - #region Methods public static void AddType(String name) { @@ -39,5 +36,4 @@ public static void AddType(Type type, String name) public static String GetTypeName(Object o) => TypeMap.Map[o.GetType()]; - #endregion } \ No newline at end of file diff --git a/Shared/HealthChecks/HealthCheckMiddleware.cs b/Shared/HealthChecks/HealthCheckMiddleware.cs index 389ce2e3..856cc6cb 100644 --- a/Shared/HealthChecks/HealthCheckMiddleware.cs +++ b/Shared/HealthChecks/HealthCheckMiddleware.cs @@ -13,7 +13,6 @@ [ExcludeFromCodeCoverage] public static class HealthCheckMiddleware { - #region Methods public static Task WriteResponse(HttpContext context, HealthReport healthReport) { @@ -51,5 +50,4 @@ public static Task WriteResponse(HttpContext context, return context.Response.WriteAsync(Encoding.UTF8.GetString(memoryStream.ToArray())); } - #endregion } \ No newline at end of file diff --git a/Shared/HealthChecks/HealthCheckResult.cs b/Shared/HealthChecks/HealthCheckResult.cs index 06c64c51..ce714c9c 100644 --- a/Shared/HealthChecks/HealthCheckResult.cs +++ b/Shared/HealthChecks/HealthCheckResult.cs @@ -7,7 +7,5 @@ [ExcludeFromCodeCoverage] public class HealthCheckResult { - #region Properties public String Status { get; set; } - #endregion } \ No newline at end of file diff --git a/Shared/HealthChecks/IHealthCheckClient.cs b/Shared/HealthChecks/IHealthCheckClient.cs index 62a0e5b8..67ede375 100644 --- a/Shared/HealthChecks/IHealthCheckClient.cs +++ b/Shared/HealthChecks/IHealthCheckClient.cs @@ -8,12 +8,10 @@ namespace Shared.HealthChecks; public interface IHealthCheckClient { - #region Methods Task> PerformHealthCheck(String scheme, String uri, Int32 port, CancellationToken cancellationToken); - #endregion } \ No newline at end of file diff --git a/Shared/ValueObjects/Money.cs b/Shared/ValueObjects/Money.cs index d2b87109..9fc230bf 100644 --- a/Shared/ValueObjects/Money.cs +++ b/Shared/ValueObjects/Money.cs @@ -8,7 +8,6 @@ /// public record Money { - #region Constructors /// /// Initializes a new instance of the class. @@ -19,9 +18,7 @@ private Money(Decimal value) this.Value = value; } - #endregion - #region Properties /// /// Gets the value. @@ -31,9 +28,7 @@ private Money(Decimal value) /// public Decimal Value { get; } - #endregion - #region Methods /// /// Creates the specified value. @@ -73,5 +68,4 @@ public static Money Create(Decimal value) return new Money(leftHand.Value - rightHand.Value); } - #endregion } \ No newline at end of file diff --git a/Shared/ValueObjects/PositiveMoney.cs b/Shared/ValueObjects/PositiveMoney.cs index 405fac37..445c6f9a 100644 --- a/Shared/ValueObjects/PositiveMoney.cs +++ b/Shared/ValueObjects/PositiveMoney.cs @@ -8,7 +8,6 @@ /// public record PositiveMoney { - #region Constructors /// /// Initializes a new instance of the class. @@ -20,9 +19,7 @@ private PositiveMoney(Money moneyAmount) this.Money = moneyAmount; } - #endregion - #region Properties /// /// Gets the value. @@ -43,9 +40,7 @@ public Decimal Value /// private Money Money { get; } - #endregion - #region Methods /// /// Creates the specified money amount. @@ -70,5 +65,4 @@ private void GuardMonetaryAmount(Money moneyAmount) } } - #endregion } \ No newline at end of file