Ejemplo n.º 1
0
        public void SetUp()
        {
            var eventStore = new InMemoryEventStore();
            var repository = new EventSourcingRepository <TEntity>(eventStore, new StrictConcurrencyMonitor());
            var eventBus   = new FakeEventBus();

            Context = new TestingMessageHandlerContext <TEntity>(repository, eventBus);
        }
Ejemplo n.º 2
0
 public ScenarioHandlerSetter(TestingMessageHandlerContext <TEntity> context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     _context = context;
 }
Ejemplo n.º 3
0
        public ScenarioGivenSetter(THandler handler, TestingMessageHandlerContext <TEntity> context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _handler = handler;
            _context = context;
        }
Ejemplo n.º 4
0
        public ScenarioAssert(TEntity entity, THandler handler, TCommand command, TestingMessageHandlerContext <TEntity> context, object[] expected)
            : base(handler, command)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _entity   = entity;
            _context  = context;
            _expected = expected;
        }
Ejemplo n.º 5
0
        public ScenarioThenSetter(TEntity entity, THandler handler, TestingMessageHandlerContext <TEntity> context, TCommand command)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _entity  = entity;
            _handler = handler;
            _context = context;
            _command = command;
        }
Ejemplo n.º 6
0
 public static IHandlerSetter <TEntity> For <TEntity>(TestingMessageHandlerContext <TEntity> context)
     where TEntity : AggregateRoot, new()
 {
     return(new ScenarioHandlerSetter <TEntity>(context));
 }
Ejemplo n.º 7
0
 public void TearDown()
 {
     Context = null;
 }