Skip to content

Commit c6a3106

Browse files
2 parents 474e05f + bb83c45 commit c6a3106

83 files changed

Lines changed: 756 additions & 410 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GridDomain.CQRS.Messaging/MessageRouting/MessageRouterExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Linq.Expressions;
3-
using Automatonymous;
43
using GridDomain.Common;
54
using GridDomain.EventSourcing.Sagas.InstanceSagas;
65

@@ -16,7 +15,7 @@ public static void RegisterHandler<TMessage, THandler>( this IMessagesRouter rou
1615

1716
public static void RegisterSaga<TSaga,TData>(this IMessagesRouter router)
1817
where TSaga : Saga<TData>, new()
19-
where TData : class, ISagaState<State>
18+
where TData : class, ISagaState
2019
{
2120
router.RegisterSaga(new TSaga().GetDescriptor(), typeof(TSaga).Name);
2221
}

GridDomain.Domain.Tests/CompositionRootTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,28 @@ public void All_base_registrations_can_be_resolved(TransportMode transportMode)
2323
ResolveAll(container);
2424
}
2525

26+
27+
[TestCase(TransportMode.Cluster)]
28+
[TestCase(TransportMode.Standalone)]
29+
public void Container_can_be_disposed(TransportMode transportMode)
30+
{
31+
var container = CreateContainer(transportMode, new LocalDbConfiguration());
32+
var registrations = container.Registrations.ToArray();
33+
34+
foreach (var reg in registrations)
35+
{
36+
Console.WriteLine("Registration");
37+
Console.WriteLine(reg.Name);
38+
Console.WriteLine(reg.MappedToType);
39+
Console.WriteLine(reg.RegisteredType);
40+
Console.WriteLine("end of registration");
41+
Console.WriteLine();
42+
}
43+
44+
container.Dispose();
45+
}
46+
47+
2648
protected abstract IUnityContainer CreateContainer(TransportMode mode, IDbConfiguration conf);
2749

2850
private void ResolveAll(IUnityContainer container)

GridDomain.Domain.Tests/DependencyInjection/AggregatesDI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected override GridDomainNode CreateGridDomainNode(AkkaConfiguration akkaCon
3232
var container = new UnityContainer();
3333

3434
container.RegisterType<ITestDependency, TestDependencyImplementation>();
35-
container.RegisterInstance<IUnityContainer>(container);
35+
// container.RegisterInstance<IUnityContainer>(container);
3636
container.RegisterInstance<IQuartzConfig>(new InMemoryQuartzConfig());
3737
container.RegisterAggregate<TestAggregate,TestAggregatesCommandHandler>();
3838

GridDomain.Domain.Tests/FutureEvents/Cancelation/Given_aggregate_When_cancel_existing_future_event.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Linq;
33
using GridDomain.EventSourcing;
44
using GridDomain.EventSourcing.Sagas.FutureEvents;
5+
using GridDomain.Tests.Framework;
56
using GridDomain.Tests.FutureEvents.Infrastructure;
67
using NUnit.Framework;
78

GridDomain.Domain.Tests/FutureEvents/Cancelation/Given_aggregate_When_cancel_not_existing_future_event.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using GridDomain.EventSourcing;
33
using GridDomain.EventSourcing.Sagas.FutureEvents;
4+
using GridDomain.Tests.Framework;
45
using GridDomain.Tests.FutureEvents.Infrastructure;
56
using NUnit.Framework;
67

GridDomain.Domain.Tests/FutureEvents/Given_aggregate_When_raising_future_event_by_methods.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using GridDomain.EventSourcing.Sagas.FutureEvents;
33
using GridDomain.Node.FutureEvents;
4+
using GridDomain.Tests.Framework;
45
using GridDomain.Tests.FutureEvents.Infrastructure;
56
using NUnit.Framework;
67

GridDomain.Domain.Tests/GridDomain.Tests.csproj

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@
150150
<HintPath>..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
151151
<Private>True</Private>
152152
</Reference>
153+
<Reference Include="NMoneys, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
154+
<HintPath>..\packages\NMoneys.4.2.0.0\lib\Net40-client\NMoneys.dll</HintPath>
155+
<Private>True</Private>
156+
</Reference>
153157
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
154158
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
155159
<Private>True</Private>
@@ -204,6 +208,7 @@
204208
<Private>True</Private>
205209
</Reference>
206210
<Reference Include="System.Core" />
211+
<Reference Include="System.Xml" />
207212
<Reference Include="Wire, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
208213
<HintPath>..\packages\Wire.0.0.6\lib\Wire.dll</HintPath>
209214
<Private>True</Private>
@@ -215,11 +220,9 @@
215220
<Compile Include="DateTimeSpec.cs" />
216221
<Compile Include="DependencyInjection\AggregateActor_can_be_created_with_iServiceLocator.cs" />
217222
<Compile Include="DependencyInjection\Given_configured_container_When_executing_aggregate_handler.cs" />
218-
<Compile Include="FutureEvents\AggregateDebugExtensions.cs" />
219223
<Compile Include="FutureEvents\Cancelation\Given_aggregate_When_cancel_not_existing_future_event.cs" />
220224
<Compile Include="FutureEvents\Cancelation\Given_aggregate_When_cancel_existing_future_event.cs" />
221225
<Compile Include="FutureEvents\Cancelation\Given_future_event_in_aggregate_When_cancelling_it.cs" />
222-
<Compile Include="FutureEvents\CannotFindRequestedEventException.cs" />
223226
<Compile Include="FutureEvents\Given_aggregate_When_raising_future_event_by_methods.cs" />
224227
<Compile Include="FutureEvents\Given_aggregate_When_raising_several_future_events.cs" />
225228
<Compile Include="FutureEvents\Given_aggregate_When_raising_future_event_by_commands.cs" />
@@ -229,15 +232,15 @@
229232
<Compile Include="FutureEvents\Raising_future_events_too_late.cs" />
230233
<Compile Include="FutureEvents\Reraising_future_event.cs" />
231234
<Compile Include="Given_Node_When_Start_TrasportRegistrations_Test.cs" />
232-
<Compile Include="Sagas\InstanceSagas\Commands\GoSleepCommand.cs" />
235+
<Compile Include="Sagas\SoftwareProgrammingDomain\Commands\GoSleepCommand.cs" />
233236
<Compile Include="Sagas\InstanceSagas\CreateSagaGraph.cs" />
234-
<Compile Include="Sagas\InstanceSagas\Events\CoffeMakeFailedDomainEvent.cs" />
235-
<Compile Include="Sagas\InstanceSagas\Commands\MakeCoffeCommand.cs" />
236-
<Compile Include="Sagas\InstanceSagas\Events\SleptWellDomainEvent.cs" />
237-
<Compile Include="Sagas\InstanceSagas\Events\GotTiredDomainEvent.cs" />
238-
<Compile Include="Sagas\InstanceSagas\Events\CoffeMadeDomainEvent.cs" />
237+
<Compile Include="Sagas\SoftwareProgrammingDomain\Events\CoffeMakeFailedEvent.cs" />
238+
<Compile Include="Sagas\SoftwareProgrammingDomain\Commands\MakeCoffeCommand.cs" />
239+
<Compile Include="Sagas\SoftwareProgrammingDomain\Events\SleptWellEvent.cs" />
240+
<Compile Include="Sagas\SoftwareProgrammingDomain\Events\GotTiredEvent.cs" />
241+
<Compile Include="Sagas\SoftwareProgrammingDomain\Events\CoffeMadeEvent.cs" />
239242
<Compile Include="Sagas\InstanceSagas\Given_istance_saga_saga_actor_can_be_created.cs" />
240-
<Compile Include="Sagas\InstanceSagas\Recover\Given_instance_saga_When_recovering.cs" />
243+
<Compile Include="Sagas\InstanceSagas\Recovery\Given_instance_saga_When_recovering.cs" />
241244
<Compile Include="Sagas\InstanceSagas\SagaDataAggregateCommandsHandlerDummy.cs" />
242245
<Compile Include="Sagas\InstanceSagas\Saga_produced_events_and_commands_has_sagaId.cs" />
243246
<Compile Include="Sagas\SagaRecycling\SagaRecyclingTest.cs" />
@@ -263,9 +266,13 @@
263266
<Compile Include="Sagas\InstanceSagas\Transitions\Given_created_event_when_hydrating.cs" />
264267
<Compile Include="Sagas\StateSagas\SagaStart_with_predefined_id_messaging.cs" />
265268
<Compile Include="Sagas\StateSagas\SagaStart_with_predifined_id_and_state_aggregate_change_in_process.cs" />
266-
<Compile Include="Sagas\StateSagas\SampleSaga\Events\GotMoreTiredEvent.cs" />
267-
<Compile Include="Sagas\StateSagas\SampleSaga\GotMoreTiredSagaEvent.cs" />
269+
<Compile Include="Sagas\StateSagas\SampleSaga\BadCoffeMachineRememberedEvent.cs" />
270+
<Compile Include="Sagas\StateSagas\SampleSaga\PersonRememberedEvent.cs" />
268271
<Compile Include="Sagas\StateSagas\SoftwareProgramming_StateSaga_Test.cs" />
272+
<Compile Include="Sagas\StateSagas\Transitions\Given_AutomatonymousSagas_When_apply_known_but_not_mapped_event_in_state.cs" />
273+
<Compile Include="Sagas\StateSagas\Transitions\Given_StateSaga_When_invalid_Transitions.cs" />
274+
<Compile Include="Sagas\StateSagas\Transitions\Given_AutomatonymousSaga_When_valid_Transitions.cs" />
275+
<Compile Include="Sagas\StateSagas\Transitions\Given_State_SoftareProgramming_Saga.cs" />
269276
<Compile Include="SampleDomain\ProjectionBuilders\AggregateChangedEventNotification.cs" />
270277
<Compile Include="AsyncAggregates\When_async_method_is_called_domainEvents_are_persisted.cs" />
271278
<Compile Include="AsyncAggregates\Given_async_events_execute.cs" />
@@ -346,11 +353,6 @@
346353
<Compile Include="Sagas\InstanceSagas\Given_saga_When_publishing_start_message.cs" />
347354
<Compile Include="Sagas\StateSagas\Given_several_repeating_messages_should_dispatch_only_one_command.cs" />
348355
<Compile Include="Sagas\StateSagas\SubscriptionRenewSagaStateTransitionTests.cs" />
349-
<Compile Include="Sagas\StateSagas\SampleSaga\Commands\SleepWellCommand.cs" />
350-
<Compile Include="Sagas\StateSagas\SampleSaga\Commands\DrinkCupOfCoffeCommand.cs" />
351-
<Compile Include="Sagas\StateSagas\SampleSaga\Events\SleptWellEvent.cs" />
352-
<Compile Include="Sagas\StateSagas\SampleSaga\Events\GotTiredEvent.cs" />
353-
<Compile Include="Sagas\StateSagas\SampleSaga\Events\FeltGoodEvent.cs" />
354356
<Compile Include="Sagas\StateSagas\SampleSaga\SoftwareProgrammingSaga.cs" />
355357
<Compile Include="SyncProjection\SynchronizedProjectionBuildersTests.cs" />
356358
<Compile Include="ThenAttribute.cs" />

GridDomain.Domain.Tests/Sagas/InstanceSagas/Events/CoffeMakeFailedDomainEvent.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

GridDomain.Domain.Tests/Sagas/InstanceSagas/Events/SleptWellDomainEvent.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

GridDomain.Domain.Tests/Sagas/InstanceSagas/Given_istance_saga_saga_actor_can_be_created.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using GridDomain.EventSourcing.Sagas.InstanceSagas;
66
using GridDomain.Node;
77
using GridDomain.Node.Actors;
8-
using GridDomain.Tests.Sagas.InstanceSagas.Events;
8+
using GridDomain.Tests.Sagas.SoftwareProgrammingDomain.Events;
99
using NUnit.Framework;
1010

1111
namespace GridDomain.Tests.Sagas.InstanceSagas
@@ -18,7 +18,7 @@ public void Saga_actor_can_be_created()
1818
{
1919
var actorType = typeof(SagaActor<ISagaInstance<SoftwareProgrammingSaga, SoftwareProgrammingSagaData>,
2020
SagaDataAggregate<SoftwareProgrammingSagaData>,
21-
GotTiredDomainEvent>);
21+
GotTiredEvent>);
2222

2323
var actor = GridNode.System.CreatePersistedIdentityActor(actorType, Guid.Empty);
2424
actor.Ask(new DomainEvent(Guid.NewGuid()));

0 commit comments

Comments
 (0)