diff --git a/src/EventStoreEventTools.Tests/EventStoreEventTools.Tests.csproj b/src/EventStoreEventTools.Tests/EventStoreEventTools.Tests.csproj
new file mode 100644
index 0000000..42d3c29
--- /dev/null
+++ b/src/EventStoreEventTools.Tests/EventStoreEventTools.Tests.csproj
@@ -0,0 +1,31 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+ false
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
diff --git a/src/EventStoreEventTools.Tests/EventStoreEventToolsTests.cs b/src/EventStoreEventTools.Tests/EventStoreEventToolsTests.cs
new file mode 100644
index 0000000..3464048
--- /dev/null
+++ b/src/EventStoreEventTools.Tests/EventStoreEventToolsTests.cs
@@ -0,0 +1,37 @@
+namespace EventStoreEventTools.Tests
+{
+ using NUnit.Framework;
+ using EventStore.Client;
+ using CorshamScience.Tools.EventStore;
+ using Newtonsoft.Json;
+ using System.Text;
+
+ internal class EventStoreEventToolsTests
+ {
+ [Test]
+ public void ToEventData_Given_Valid_Event_Returns_EventData()
+ {
+ var standardEvent = new StandardEvent
+ {
+ Id = Uuid.NewUuid(),
+ Description = "Test",
+ };
+
+ var data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(standardEvent));
+ var eventHeaders = new { ClrType = standardEvent.GetType().AssemblyQualifiedName };
+
+ var metadata = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(eventHeaders));
+ var typeName = standardEvent.GetType().Name;
+
+ var expectedObject = new EventData(standardEvent.Id, typeName, data, metadata);
+
+ var toEventData = EventStoreEventTools.ToEventData(standardEvent.Id, standardEvent);
+ Assert.That(JsonConvert.SerializeObject(toEventData), Is.EqualTo(JsonConvert.SerializeObject(expectedObject)));
+ }
+ private class StandardEvent
+ {
+ public Uuid Id { get; set; }
+ public string? Description { get; set; }
+ }
+ }
+}
diff --git a/src/Tools.EventStore.sln b/src/Tools.EventStore.sln
index e6b7efd..d3a0914 100644
--- a/src/Tools.EventStore.sln
+++ b/src/Tools.EventStore.sln
@@ -1,9 +1,11 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27703.2000
+# Visual Studio Version 17
+VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools.EventStore", "Tools.EventStore\Tools.EventStore.csproj", "{1FEA1406-472C-471E-96C6-3F075DD50FD3}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tools.EventStore", "Tools.EventStore\Tools.EventStore.csproj", "{1FEA1406-472C-471E-96C6-3F075DD50FD3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventStoreEventTools.Tests", "EventStoreEventTools.Tests\EventStoreEventTools.Tests.csproj", "{DCC4AC2A-9B1D-41FA-B450-818C62D2D158}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +17,10 @@ Global
{1FEA1406-472C-471E-96C6-3F075DD50FD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FEA1406-472C-471E-96C6-3F075DD50FD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FEA1406-472C-471E-96C6-3F075DD50FD3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DCC4AC2A-9B1D-41FA-B450-818C62D2D158}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DCC4AC2A-9B1D-41FA-B450-818C62D2D158}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DCC4AC2A-9B1D-41FA-B450-818C62D2D158}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DCC4AC2A-9B1D-41FA-B450-818C62D2D158}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/Tools.EventStore/EventStoreClientBuilder.cs b/src/Tools.EventStore/EventStoreClientBuilder.cs
new file mode 100644
index 0000000..40bf141
--- /dev/null
+++ b/src/Tools.EventStore/EventStoreClientBuilder.cs
@@ -0,0 +1,26 @@
+//
+// Copyright (c) Corsham Science. All rights reserved.
+//
+
+namespace CorshamScience.Tools.EventStore
+{
+ using System;
+ using global::EventStore.Client;
+
+ ///
+ /// A helper class for quickly building an .
+ ///
+ public static class EventStoreClientBuilder
+ {
+ ///
+ /// Builds an using the default settings.
+ ///
+ /// Put valid connection string.
+ /// EventStoreClient.
+ public static EventStoreClient GetEventStoreClient(string connectionString)
+ {
+ var settings = EventStoreClientSettings.Create(connectionString);
+ return new EventStoreClient(settings);
+ }
+ }
+}
diff --git a/src/Tools.EventStore/EventStoreConnectionBuilder.cs b/src/Tools.EventStore/EventStoreConnectionBuilder.cs
deleted file mode 100644
index 9370321..0000000
--- a/src/Tools.EventStore/EventStoreConnectionBuilder.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// Copyright (c) Corsham Science. All rights reserved.
-//
-
-namespace CorshamScience.Tools.EventStore
-{
- using System;
- using global::EventStore.ClientAPI;
-
- ///
- /// A helper class for quickly building an .
- ///
- // ReSharper disable once UnusedMember.Global
- public static class EventStoreConnectionBuilder
- {
- ///
- /// Build an using the passed in connection and configuration.
- ///
- /// The URI for the Event Store's external TCP port, including login details.
- /// An optional maximum allowed retries for any given operation; this defaults to 10.
- /// An optional gossip timeout for the EventStore connection; this defaults to 5 seconds.
- /// An optional to use to log information about and issues with the .
- /// An optional action to call when the disconnects. If no action is passed in, but a logger is, disconnection will result in an error logging event.
- /// An optional action to call when the connects. If no action is passed in, but a logger is, connection will result in an info logging event.
- /// An optional action to call when the is reconnecting. If no action is passed in, but a logger is, reconnection will result in an error logging event.
- /// An optional action to call when the is closed. If no action is passed in, but a logger is, closure will result in an info logging event.
- /// An optional action to call when the encounters an error. If no action is passed in, but a logger is, an error occurring will result in an error error logging event.
- /// A configured, connected which uses any passed in configuration variables, or the defaults detailed in the parameters section.
- // ReSharper disable once UnusedMember.Global
- public static IEventStoreConnection SetUpEventStoreConnection(
- Uri connection,
- int retryLimit = 10,
- TimeSpan? gossipTimeout = null,
- ILogger logger = null,
- Action