public CardActivityTests(EsdbFixture esdb)
 {
     _esdb       = esdb;
     _repository = new InMemoryCardActivityRepository();
     _runner     = new ProjectionRunner(esdb.Client, new NullLogger <ProjectionRunner>(), new Projection[]
     {
         new CardActivityProjection(_repository)
     });
 }
 public CardsController(ICommandHandler <OpenTask> openTaskHandler,
                        ICommandHandler <AssignCard> assignCardHandler,
                        ICommandHandler <StartDevelopment> startDevelopmentHandler,
                        ICardActivityRepository repository)
 {
     _openTaskHandler         = openTaskHandler;
     _assignCardHandler       = assignCardHandler;
     _startDevelopmentHandler = startDevelopmentHandler;
     _repository = repository;
 }
Exemple #3
0
        public CardActivityProjection(ICardActivityRepository repository)
        {
            When <TaskOpened>(async e =>
            {
                await repository.AppendActivityToCard(e.CardId, $"Task '{e.Title}' was opened");
            });

            When <CardAssigned>(async e =>
            {
                await repository.AppendActivityToCard(e.CardId, $"Card was assigned to {e.CurrentAssignee}");
            });

            When <DevelopmentStarted>(async e =>
            {
                await repository.AppendActivityToCard(e.CardId, "Development was started");
            });
        }