Example #1
0
        public with_a_BetController()
        {
            player_authenticator = MockRepository.GenerateStub <IPlayerAuthenticator>();
            command_bus          = MockRepository.GenerateStub <ICommandBus>();
            query_service        = MockRepository.GenerateStub <IQueryService>();
            bet_command_mapper   = MockRepository.GenerateStub <ICommandMapper <BetCommand, BetView> >();

            SUT = new BetController(player_authenticator, command_bus, query_service, bet_command_mapper);
        }
        public with_a_BetController()
        {
            player_authenticator = MockRepository.GenerateStub<IPlayerAuthenticator>();
            command_bus = MockRepository.GenerateStub<ICommandBus>();
            query_service = MockRepository.GenerateStub<IQueryService>();
            bet_command_mapper = MockRepository.GenerateStub<ICommandMapper<BetCommand, BetView>>();

            SUT = new BetController(player_authenticator, command_bus, query_service, bet_command_mapper);
        }
 public CommandManager(IPlateu plateu, ICommandMapper commandMapper, ICommandInvoker commandInvoker, IOutputGenerator outputGenerator)
 {
     rovers               = new List <IRover>();
     this.plateu          = plateu;
     this.commandMapper   = commandMapper;
     this.commandInvoker  = commandInvoker;
     this.outputGenerator = outputGenerator;
     this.commandInvoker.SetPlateu(this.plateu);
     this.commandInvoker.SetRovers(rovers);
 }
 public BetController(IPlayerAuthenticator player_authenticator,
                      ICommandBus command_bus,
                      IQueryService query_service,
                      ICommandMapper <BetCommand, BetView> bet_command_mapper)
 {
     _player_authenticator = player_authenticator;
     _command_bus          = command_bus;
     _query_service        = query_service;
     _bet_command_mapper   = bet_command_mapper;
 }
Example #5
0
 internal TestContext(InMemoryEventStore eventStore, IAggregateRootRepository aggregateRootRepository, IEventDispatcher eventDispatcher,
                      IDomainEventSerializer domainEventSerializer, ICommandMapper commandMapper, IDomainTypeNameMapper domainTypeNameMapper)
 {
     _eventStore = eventStore;
     _aggregateRootRepository = aggregateRootRepository;
     _eventDispatcher         = eventDispatcher;
     _domainEventSerializer   = domainEventSerializer;
     _testCommandMapper       = commandMapper;
     _domainTypeNameMapper    = domainTypeNameMapper;
 }
 public BetController(IPlayerAuthenticator player_authenticator, 
                      ICommandBus command_bus,
                      IQueryService query_service,
                      ICommandMapper<BetCommand, BetView> bet_command_mapper)
 {
     _player_authenticator = player_authenticator;
     _command_bus = command_bus;
     _query_service = query_service;
     _bet_command_mapper = bet_command_mapper;
 }
Example #7
0
 private void AddOrUpdateMapper(ICommandMapper mapper)
 {
     lock (_mappers)
     {
         if (!_mappers.ContainsKey(mapper.PropertyName))
         {
             _mappers.Add(mapper.PropertyName, mapper);
         }
         else
         {
             _mappers[mapper.PropertyName] = mapper;
         }
     }
 }
Example #8
0
        internal TestContext(InMemoryEventStore eventStore, IAggregateRootRepository aggregateRootRepository, IEventDispatcher eventDispatcher,
                             IDomainEventSerializer domainEventSerializer, ICommandMapper commandMapper, IDomainTypeNameMapper domainTypeNameMapper)
        {
            _eventStore = eventStore;
            _aggregateRootRepository = aggregateRootRepository;
            _eventDispatcher         = eventDispatcher;
            _domainEventSerializer   = domainEventSerializer;
            _testCommandMapper       = commandMapper;
            _domainTypeNameMapper    = domainTypeNameMapper;

            _viewManagerEventDispatcher = eventDispatcher as ViewManagerEventDispatcher;
            if (_viewManagerEventDispatcher != null)
            {
                _waitHandle.Register(_viewManagerEventDispatcher);
            }
        }
        public CommandProcessor(
            IEventStore eventStore, IAggregateRootRepository aggregateRootRepository, IEventDispatcher eventDispatcher,
            IDomainEventSerializer domainEventSerializer, ICommandMapper commandMapper, IDomainTypeNameMapper domainTypeNameMapper,
            Options options)
        {
            if (eventStore == null)
            {
                throw new ArgumentNullException("eventStore");
            }
            if (aggregateRootRepository == null)
            {
                throw new ArgumentNullException("aggregateRootRepository");
            }
            if (eventDispatcher == null)
            {
                throw new ArgumentNullException("eventDispatcher");
            }
            if (domainEventSerializer == null)
            {
                throw new ArgumentNullException("domainEventSerializer");
            }
            if (commandMapper == null)
            {
                throw new ArgumentNullException("commandMapper");
            }
            if (domainTypeNameMapper == null)
            {
                throw new ArgumentNullException("domainTypeNameMapper");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            _eventStore = eventStore;
            _aggregateRootRepository = aggregateRootRepository;
            _eventDispatcher         = eventDispatcher;
            _domainEventSerializer   = domainEventSerializer;
            _commandMapper           = commandMapper;
            _domainTypeNameMapper    = domainTypeNameMapper;
            _options = options;
        }
Example #10
0
        public CommandProcessor(
            IEventStore eventStore, IAggregateRootRepository aggregateRootRepository, IEventDispatcher eventDispatcher,
            IDomainEventSerializer domainEventSerializer, ICommandMapper commandMapper, IDomainTypeNameMapper domainTypeNameMapper,
            Options options)
        {
            if (eventStore == null) throw new ArgumentNullException("eventStore");
            if (aggregateRootRepository == null) throw new ArgumentNullException("aggregateRootRepository");
            if (eventDispatcher == null) throw new ArgumentNullException("eventDispatcher");
            if (domainEventSerializer == null) throw new ArgumentNullException("domainEventSerializer");
            if (commandMapper == null) throw new ArgumentNullException("commandMapper");
            if (domainTypeNameMapper == null) throw new ArgumentNullException("domainTypeNameMapper");
            if (options == null) throw new ArgumentNullException("options");

            _eventStore = eventStore;
            _aggregateRootRepository = aggregateRootRepository;
            _eventDispatcher = eventDispatcher;
            _domainEventSerializer = domainEventSerializer;
            _commandMapper = commandMapper;
            _domainTypeNameMapper = domainTypeNameMapper;
            _options = options;
        }
Example #11
0
 public CommandMapperDecorator(ICommandMapper innerCommandMapper, CommandMappings commandMappings)
 {
     _innerCommandMapper = innerCommandMapper;
     _commandMappings    = commandMappings;
 }
 public YugiohCardService(ICardService cardService, ICommandMapper commandMapper)
 {
     _cardService   = cardService;
     _commandMapper = commandMapper;
 }
Example #13
0
 public Custrepo(ICommandMapper <OperatorWithClient> mapper, IDbConnectionExecutables conn) : base(mapper, conn)
 {
 }
 public void map_to_different_Type_but_identical_Event_returns_different_mapper()
 {
     mapper = subject.Map(SupportEvent.Type.TYPE1, typeof(SupportEvent));
     Assert.That(subject.Map(SupportEvent.Type.TYPE2, typeof(SupportEvent)), Is.Not.EqualTo(mapper));
 }
Example #15
0
        public override void OnConfiguring(ICommandMapper mapper)
        {
            mapper.Map <CreateUserCommand, User>(k => k.UserId);

            mapper.Map <ModifyUserNameCommand, User>(k => k.UserId);
        }
Example #16
0
 public GenericRepository(ICommandMapper <TEntity> mapper, IDbConnectionExecutables conn)
 {
     this.mapper = mapper;
     this.conn   = conn;
 }
Example #17
0
 public abstract void OnConfiguring(ICommandMapper mapper);
Example #18
0
 public UoWMappedCommandExecutor(ICommandMapper commandMapper)
 {
     _commandMapper = commandMapper;
 }
Example #19
0
 internal ICommandMapper CreateCommandMapperDecorator(ICommandMapper innerCommandMapper)
 {
     return(new CommandMapperDecorator(innerCommandMapper, this));
 }
		public void map_to_different_Type_but_identical_Event_returns_different_mapper()
		{
			mapper = subject.Map(SupportEvent.Type.TYPE1, typeof(SupportEvent));
			Assert.That (subject.Map (SupportEvent.Type.TYPE2, typeof(SupportEvent)), Is.Not.EqualTo (mapper));
		}
Example #21
0
 public void Map(ICommandMapper mapper)
 {
     AddOrUpdateMapper(mapper);
 }
 public void unmap_returns_mapper()
 {
     mapper = subject.Map(SupportEvent.Type.TYPE1, typeof(SupportEvent));
     Assert.That(subject.Unmap(SupportEvent.Type.TYPE1, typeof(SupportEvent)), Is.InstanceOf(typeof(ICommandUnmapper)));
 }
		public void unmap_returns_mapper()
		{
			mapper = subject.Map(SupportEvent.Type.TYPE1, typeof(SupportEvent));
			Assert.That(subject.Unmap(SupportEvent.Type.TYPE1, typeof(SupportEvent)), Is.InstanceOf(typeof(ICommandUnmapper)));
		}
Example #24
0
 public ClientRepo(ICommandMapper <Client> mapper, IDbConnectionExecutables conn) : base(mapper, conn)
 {
 }
Example #25
0
 public UserInputBehaviour(IProgramLogger log, ICommandMapper mapper)
 {
     _log    = log;
     _mapper = mapper;
 }