Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Driver/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class Program
#region Methods

internal static EventStoreClientSettings ConfigureEventStoreSettings() {
EventStoreClientSettings settings = new(); //EventStoreClientSettings.Create("esdb://127.0.0.1:2113?tls=trur");
EventStoreClientSettings settings = new();

settings.CreateHttpMessageHandler = () => new SocketsHttpHandler {
SslOptions = {
Expand All @@ -43,10 +43,6 @@ internal static EventStoreClientSettings ConfigureEventStoreSettings() {
private static async Task Main(String[] args) {
Logger.Initialise(NullLogger.Instance);
await Program.SubscriptionsTest();
//await Program.QueryTest();

//TestDockerHelper t = new TestDockerHelper();
//await t.StartContainersForScenarioRun("");

Console.ReadKey();
}
Expand All @@ -69,8 +65,6 @@ private static async Task SubscriptionsTest() {

ISubscriptionRepository subscriptionRepository = SubscriptionRepository.Create(eventStoreConnectionString, cacheDuration);

//((SubscriptionRepository)subscriptionRepository).Trace += (sender, s) => Extensions.log(TraceEventType.Information, "REPOSITORY", s);

// init our SubscriptionRepository
subscriptionRepository.PreWarm(CancellationToken.None).Wait();

Expand All @@ -90,10 +84,6 @@ private static async Task SubscriptionsTest() {
}

#endregion

#region Others

#endregion
}


Expand Down
1 change: 0 additions & 1 deletion Shared.EventStore.Tests/AggregateExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public void AggregateExtensions_IsEventDuplicate_EventsIsNotADuplicate(Boolean c
public void AggregateExtensions_GetPendingEvents_EventIsApplied()
{
TestAggregate t = TestAggregate.Create(TestData.AggregateId);
AggregateNameSetEvent aggregateNameSetEvent = new AggregateNameSetEvent(TestData.AggregateId, TestData.EventId, "Test");
t.CommitPendingEvents();
IList<IDomainEvent> events = t.GetPendingEvents();
events.Count.ShouldBe(0);
Expand Down
4 changes: 1 addition & 3 deletions Shared.EventStore.Tests/DomainEventHandlerResolverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public void DomainEventHandlerResolver_EventNotConfigured_NullReturned()
return new TestDomainEventHandler();
};

List<String> handlers = new List<String>();

DomainEventHandlerResolver r = new DomainEventHandlerResolver(eventHandlerConfiguration, createEventHandlerFunc);
List<IDomainEventHandler> result = r.GetDomainEventHandlers(new EstateCreatedEvent(TestData.AggregateId, TestData.EstateName));
result.ShouldBeNull();
Expand All @@ -56,7 +54,7 @@ public void DomainEventHandlerResolver_GetDomainEventHandlers_NoHandlerFound_Err
eventHandlerConfiguration.Add("EstateCreatedEvent", handlers.ToArray());

Should.Throw<NotSupportedException>(() => {
DomainEventHandlerResolver r = new DomainEventHandlerResolver(eventHandlerConfiguration, createEventHandlerFunc);
new DomainEventHandlerResolver(eventHandlerConfiguration, createEventHandlerFunc);
});
}
}
Expand Down
190 changes: 0 additions & 190 deletions Shared.EventStore.Tests/IApplicationBuilderExtenstionsTests.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Shared.EventStore.Tests/ProjectionHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ public async Task ProjectionHandler_Handle_NullEvent_EventHandled()
[Fact]
public async Task ProjectionHandler_Handle_EventNotHandled_EventHandled()
{
TestState originalState = new TestState();
TestState updatedState = new TestState
{
Name = "Test Name"
};

Mock<IProjectionStateRepository<TestState>> projectionStateRepository = new Mock<IProjectionStateRepository<TestState>>();
Mock<IProjection<TestState>> projection = new Mock<IProjection<TestState>>();
projection.Setup(p => p.ShouldIHandleEvent(It.IsAny<IDomainEvent>())).Returns(false);
Expand Down
1 change: 0 additions & 1 deletion Shared.EventStore/Aggregate/EventDataFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class EventDataFactory : IEventDataFactory
/// </summary>
public EventDataFactory()
{
//this.Serialiser = new JsonSerialiser(jsonOptionsFunc);
JsonConvert.DefaultSettings = EventDataFactory.jsonOptionsFunc;
}

Expand Down
6 changes: 0 additions & 6 deletions Shared.EventStore/EventStore/EventStoreContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ public async Task<Result> InsertEvents(String streamName,
Object metadata,
CancellationToken cancellationToken)
{
List<EventData> eventData = new List<EventData>();
JsonSerializerSettings s = new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All
};

this.LogInformation($"About to append {aggregateEvents.Count} to Stream {streamName}");
try {
await this.EventStoreClient.AppendToStreamAsync(streamName, StreamRevision.FromInt64(expectedVersion),
Expand Down
2 changes: 2 additions & 0 deletions Shared.EventStore/EventStore/IEventStoreContextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace Shared.EventStore.EventStore

public interface IEventStoreContextManager
{
event TraceHandler TraceGenerated;

IEventStoreContext GetEventStoreContext(String connectionIdentifier, String connectionStringIdentifier);

IEventStoreContext GetEventStoreContext(String connectionIdentifier);
Expand Down
39 changes: 1 addition & 38 deletions Shared.EventStoreContext.Tests/EventStoreContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public EventStoreContextTests(){
#region Methods

public void Dispose(){

// Just needed for the interface
}

[OneTimeTearDown]
Expand Down Expand Up @@ -351,42 +351,5 @@ private IEventStoreContext CreateContext(Boolean secureEventStore, TimeSpan? dea

#endregion


//private async Task<String> RunTransientQuery(IEventStoreContext context, String query, Int32 checkType, TimeSpan? deadline = null, TimeSpan? retryTimeout = null){
// Int32 counter = 0;
// String queryResult = null;
// await Retry.For(async () => {
// counter++;
// this.EventStoreDockerHelper.Trace($"Inside Retry Counter [{counter}] Check Type [{checkType}]");
// Result<String>? queryResult = await context.RunTransientQuery(query, CancellationToken.None);
// if (checkType == 1){
// queryResult.IsFailed.ShouldBeTrue();

// String errors = String.Join("|", queryResult.Errors);
// this.EventStoreDockerHelper.Trace(errors);
// if (errors.Any()) {
// errors.Contains("Faulted").ShouldBeTrue();
// }
// else {
// queryResult.Message.Contains("Faulted").ShouldBeTrue();
// }
// }
// else{

// switch(checkType){
// case 2: // Not Null or Empty
// queryResult.Data.ShouldNotBeNullOrEmpty();
// break;
// case 3: // Empty
// queryResult.Data.ShouldBeEmpty();
// break;
// }
// }
// },
// retryTimeout,
// deadline);
// return queryResult;

//}
}
}
2 changes: 1 addition & 1 deletion Shared.Tests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static ErrorResponse GetErrorResponse(DefaultHttpContext context)
return responseData;
}

public const String ExceptionMessage = "Test Exception Message";
public static readonly String ExceptionMessage = "Test Exception Message";

public static T CreateException<T>() where T : Exception{
return (T)System.Activator.CreateInstance(typeof(T), TestHelpers.ExceptionMessage);
Expand Down