Ejemplo n.º 1
0
        public given_a_view_model_generator()
        {
            var bus = new Mock <ICommandBus>();

            bus.Setup(x => x.Send(It.IsAny <Envelope <ICommand> >()))
            .Callback <Envelope <ICommand> >(x => Commands.Add(x.Body));
            bus.Setup(x => x.Send(It.IsAny <IEnumerable <Envelope <ICommand> > >()))
            .Callback <IEnumerable <Envelope <ICommand> > >(x => Commands.AddRange(x.Select(e => e.Body)));

            Sut = new AccountDetailsGenerator(() => new BookingDbContext(DbName), new TestServerSettings());
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _paymentId = Guid.NewGuid();
            _orderId   = Guid.NewGuid();
            _accountId = Guid.NewGuid();
            _promoId   = Guid.NewGuid();

            var accountDetailGenerator = new AccountDetailsGenerator(() => new BookingDbContext(DbName),
                                                                     new TestServerSettings());

            accountDetailGenerator.Handle(new AccountRegistered
            {
                SourceId = _accountId,
            });

            accountDetailGenerator.Handle(new AccountConfirmed()
            {
                SourceId = _accountId
            });

            _reportDetailGenerator = new EventHandlers.ReportDetailGenerator(() => new BookingDbContext(DbName), new Logger());
        }