Skip to content

Commit

Permalink
Removed redundant Api.Testing project
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed Jun 16, 2022
1 parent 3a52081 commit 39696ce
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 304 deletions.
95 changes: 0 additions & 95 deletions Core.Api.Testing/ApiFixture.cs

This file was deleted.

22 changes: 0 additions & 22 deletions Core.Api.Testing/Core.Api.Testing.csproj

This file was deleted.

17 changes: 0 additions & 17 deletions Core.Api.Testing/ResponseExtensions.cs

This file was deleted.

43 changes: 0 additions & 43 deletions Core.Api.Testing/TestContext.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,70 +85,3 @@ public async Task ShouldPublishInternalEventOfType<TEvent>(
} while (!finished);
}
}

// public abstract class ApiWithEventsFixture<TProject>: ApiFixture<TProject> where TProject : class
// {
// private readonly EventsLog eventsLog = new();
// private readonly DummyExternalEventProducer externalEventProducer = new();
// private readonly DummyExternalCommandBus externalCommandBus = new();
//
// public override TestContext<TProject> CreateTestContext() =>
// new(services =>
// {
// SetupServices?.Invoke(services);
// services.AddSingleton(eventsLog);
// services.AddSingleton(typeof(IEventHandler<>), typeof(EventListener<>));
// services.AddSingleton<IExternalEventProducer>(externalEventProducer);
// services.AddSingleton<IEventBus>(sp =>
// new EventBusDecoratorWithExternalProducer(sp.GetRequiredService<EventBus>(),
// sp.GetRequiredService<IExternalEventProducer>()));
// services.AddSingleton<IExternalCommandBus>(externalCommandBus);
// services.AddSingleton<IExternalEventConsumer, DummyExternalEventConsumer>();
// });
//
//
// public void PublishedExternalEventsOfType<TEvent>() where TEvent : IExternalEvent
// {
// externalEventProducer.PublishedEvents.OfType<TEvent>().ToList().Should().NotBeEmpty();
// }
//
// public async Task PublishInternalEvent(object @event, CancellationToken ct = default)
// {
// using var scope = Sut.Services.CreateScope();
// var eventBus = scope.ServiceProvider.GetRequiredService<IEventBus>();
// await eventBus.Publish(@event, ct);
// }
//
// public IReadOnlyCollection<TEvent> PublishedInternalEventsOfType<TEvent>() =>
// eventsLog.PublishedEvents.OfType<TEvent>().ToList();
//
// // TODO: Add Poly here
// public async Task ShouldPublishInternalEventOfType<TEvent>(
// Expression<Func<TEvent, bool>> predicate,
// int maxNumberOfRetries = 5,
// int retryIntervalInMs = 1000)
// {
// var retryCount = maxNumberOfRetries;
// var finished = false;
//
// do
// {
// try
// {
// PublishedInternalEventsOfType<TEvent>().Should()
// .HaveCount(1)
// .And.Contain(predicate);
//
// finished = true;
// }
// catch
// {
// if (retryCount == 0)
// throw;
// }
//
// await Task.Delay(retryIntervalInMs);
// retryCount--;
// } while (!finished);
// }
// }
7 changes: 0 additions & 7 deletions EventSourcing.NetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECommerce", "Sample\EventSt
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECommerce.Api.Tests", "Sample\EventStoreDB\Simple\ECommerce.Api.Tests\ECommerce.Api.Tests.csproj", "{36C7CF36-254A-48D5-8181-9196DB1A034B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Api.Testing", "Core.Api.Testing\Core.Api.Testing.csproj", "{E96D4B8C-AF32-4434-BB5D-5C88675DC084}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECommerce.Core", "Sample\EventStoreDB\Simple\ECommerce.Core\ECommerce.Core.csproj", "{D3351193-F63A-43F1-BB70-C9F4D25887CA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventPipelines", "EventPipelines", "{D9799DB3-9D11-4909-8133-64CD96F6E1AC}"
Expand Down Expand Up @@ -593,10 +591,6 @@ Global
{36C7CF36-254A-48D5-8181-9196DB1A034B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36C7CF36-254A-48D5-8181-9196DB1A034B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36C7CF36-254A-48D5-8181-9196DB1A034B}.Release|Any CPU.Build.0 = Release|Any CPU
{E96D4B8C-AF32-4434-BB5D-5C88675DC084}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E96D4B8C-AF32-4434-BB5D-5C88675DC084}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E96D4B8C-AF32-4434-BB5D-5C88675DC084}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E96D4B8C-AF32-4434-BB5D-5C88675DC084}.Release|Any CPU.Build.0 = Release|Any CPU
{D3351193-F63A-43F1-BB70-C9F4D25887CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3351193-F63A-43F1-BB70-C9F4D25887CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3351193-F63A-43F1-BB70-C9F4D25887CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -835,7 +829,6 @@ Global
{414D1D34-1002-4159-B738-DF3EE042F9FD} = {11DD4963-5BB4-4E1B-9475-8EB10C822BFC}
{C8CBBED5-8999-4643-96E6-E56B3A940F97} = {11DD4963-5BB4-4E1B-9475-8EB10C822BFC}
{36C7CF36-254A-48D5-8181-9196DB1A034B} = {11DD4963-5BB4-4E1B-9475-8EB10C822BFC}
{E96D4B8C-AF32-4434-BB5D-5C88675DC084} = {0570E45A-2EB6-4C4C-84E4-2C80E1FECEB5}
{D3351193-F63A-43F1-BB70-C9F4D25887CA} = {11DD4963-5BB4-4E1B-9475-8EB10C822BFC}
{D9799DB3-9D11-4909-8133-64CD96F6E1AC} = {A7186B6B-D56D-4AEF-B6B7-FAA827764C34}
{622B15BD-9675-431E-B3F0-336D4E50E30F} = {D9799DB3-9D11-4909-8133-64CD96F6E1AC}
Expand Down
28 changes: 7 additions & 21 deletions Sample/ECommerce/PracticalEventSourcing.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "..\..\Core\Core.csp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Marten", "..\..\Core.Marten\Core.Marten.csproj", "{9268B3EA-71E1-4B50-A459-5732F4977942}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Testing", "..\..\Core.Testing\Core.Testing.csproj", "{8A50B198-C3ED-4DE8-8D63-11FF005C53C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.WebApi", "..\..\Core.WebApi\Core.WebApi.csproj", "{72ACB5C8-FD64-4041-BA20-BFCC5A04E97C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Carts", "Carts", "{190C033E-DF29-4F8F-A048-7E860ADD082D}"
Expand Down Expand Up @@ -62,12 +60,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A98BE9E3-8
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Kafka", "..\..\Core.Kafka\Core.Kafka.csproj", "{1B9111A1-DCA6-42BF-A073-402024780D8D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Testing", "..\..\Core.Testing\Core.Testing.csproj", "{714E605E-6EB2-41F4-A2BC-FACD7F781907}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Api.Testing", "..\..\Core.Api.Testing\Core.Api.Testing.csproj", "{3EFCB989-6F16-4D69-8C3D-7F862243FAB9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Serialization", "..\..\Core.Serialization\Core.Serialization.csproj", "{F519CFB6-9B4D-4317-B442-32B5F4EC5A4C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Testing", "..\..\Core.Testing\Core.Testing.csproj", "{E4A93074-B2CC-4036-AAC6-4AD1D9BDE9EA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -76,7 +72,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{607CC0DE-712A-4FFB-9862-FEB4F10100D2} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{9268B3EA-71E1-4B50-A459-5732F4977942} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{8A50B198-C3ED-4DE8-8D63-11FF005C53C1} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{72ACB5C8-FD64-4041-BA20-BFCC5A04E97C} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{6ED65CEC-8661-483F-A7BE-5B6EAAE7E5A2} = {190C033E-DF29-4F8F-A048-7E860ADD082D}
{AB956DE1-6927-49D3-986C-6298AD92FC04} = {190C033E-DF29-4F8F-A048-7E860ADD082D}
Expand All @@ -95,9 +90,8 @@ Global
{494CAEE8-548A-481A-AAD2-3CADD2A198B4} = {8C72B8D9-1542-4703-9530-90EABB6A6DF4}
{30E21C9B-5680-4F09-9FDA-6447A25EB1F7} = {8C72B8D9-1542-4703-9530-90EABB6A6DF4}
{1B9111A1-DCA6-42BF-A073-402024780D8D} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{714E605E-6EB2-41F4-A2BC-FACD7F781907} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{3EFCB989-6F16-4D69-8C3D-7F862243FAB9} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{F519CFB6-9B4D-4317-B442-32B5F4EC5A4C} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
{E4A93074-B2CC-4036-AAC6-4AD1D9BDE9EA} = {CC9592F6-C639-4C1E-A089-E5A7F4B9BAEA}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{607CC0DE-712A-4FFB-9862-FEB4F10100D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -108,10 +102,6 @@ Global
{9268B3EA-71E1-4B50-A459-5732F4977942}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9268B3EA-71E1-4B50-A459-5732F4977942}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9268B3EA-71E1-4B50-A459-5732F4977942}.Release|Any CPU.Build.0 = Release|Any CPU
{8A50B198-C3ED-4DE8-8D63-11FF005C53C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A50B198-C3ED-4DE8-8D63-11FF005C53C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A50B198-C3ED-4DE8-8D63-11FF005C53C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A50B198-C3ED-4DE8-8D63-11FF005C53C1}.Release|Any CPU.Build.0 = Release|Any CPU
{72ACB5C8-FD64-4041-BA20-BFCC5A04E97C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72ACB5C8-FD64-4041-BA20-BFCC5A04E97C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72ACB5C8-FD64-4041-BA20-BFCC5A04E97C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -184,17 +174,13 @@ Global
{1B9111A1-DCA6-42BF-A073-402024780D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B9111A1-DCA6-42BF-A073-402024780D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B9111A1-DCA6-42BF-A073-402024780D8D}.Release|Any CPU.Build.0 = Release|Any CPU
{714E605E-6EB2-41F4-A2BC-FACD7F781907}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{714E605E-6EB2-41F4-A2BC-FACD7F781907}.Debug|Any CPU.Build.0 = Debug|Any CPU
{714E605E-6EB2-41F4-A2BC-FACD7F781907}.Release|Any CPU.ActiveCfg = Release|Any CPU
{714E605E-6EB2-41F4-A2BC-FACD7F781907}.Release|Any CPU.Build.0 = Release|Any CPU
{3EFCB989-6F16-4D69-8C3D-7F862243FAB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3EFCB989-6F16-4D69-8C3D-7F862243FAB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3EFCB989-6F16-4D69-8C3D-7F862243FAB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EFCB989-6F16-4D69-8C3D-7F862243FAB9}.Release|Any CPU.Build.0 = Release|Any CPU
{F519CFB6-9B4D-4317-B442-32B5F4EC5A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F519CFB6-9B4D-4317-B442-32B5F4EC5A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F519CFB6-9B4D-4317-B442-32B5F4EC5A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F519CFB6-9B4D-4317-B442-32B5F4EC5A4C}.Release|Any CPU.Build.0 = Release|Any CPU
{E4A93074-B2CC-4036-AAC6-4AD1D9BDE9EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4A93074-B2CC-4036-AAC6-4AD1D9BDE9EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4A93074-B2CC-4036-AAC6-4AD1D9BDE9EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4A93074-B2CC-4036-AAC6-4AD1D9BDE9EA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Loading

0 comments on commit 39696ce

Please sign in to comment.