/Source/Bifrost.Specs/Domain/for_AggregatedRootRepository/given/a_repository_for_a_stateful_aggregated_root.cs
C# | 26 lines | 24 code | 2 blank | 0 comment | 0 complexity | 20f88a3a5f58804f12431c6ace1e1c2e MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using Bifrost.Commands;
- using Bifrost.Domain;
- using Bifrost.Events;
- using Machine.Specifications;
- using Moq;
-
- namespace Bifrost.Specs.Domain.for_AggregatedRootRepository.given
- {
- public class a_repository_for_a_stateful_aggregated_root
- {
- protected static AggregatedRootRepository<SimpleStatefulAggregatedRoot> repository;
- protected static Mock<ICommandContext> command_context_mock;
- protected static Mock<ICommandContextManager> command_context_manager_mock;
- protected static Mock<IEventStore> event_store_mock;
-
- Establish context = () =>
- {
- command_context_mock = new Mock<ICommandContext>();
- command_context_manager_mock = new Mock<ICommandContextManager>();
- event_store_mock = new Mock<IEventStore>();
- command_context_mock.Setup(c => c.EventStores).Returns(new[] {event_store_mock.Object});
- repository = new AggregatedRootRepository<SimpleStatefulAggregatedRoot>(command_context_manager_mock.Object);
- command_context_manager_mock.Setup(ccm => ccm.GetCurrent()).Returns(command_context_mock.Object);
- };
- }
- }