Пример #1
0
 public void Setup()
 {
     var scoreCalculator = new SimpleScoreCalculator();
     _scoreQuery = new ScoreQuery(new Mock<ISignaler>().Object, scoreCalculator);
     var eventBus = new DomainBus();
     eventBus.RegisterHandler(() => new GameHandler(_scoreQuery));
     var eventStorage = new InMemoryEventStorage();
     var sessionFactory = new SessionFactory(eventStorage);
     var gameService = new GameService(sessionFactory, eventBus);
     _commandbus = new DomainBus();
     _commandbus.RegisterHandler(() => gameService);
 }
Пример #2
0
        public void Setup()
        {
            var scoreCalculator = new SimpleScoreCalculator();

            _scoreQuery = new ScoreQuery(new Mock <ISignaler>().Object, scoreCalculator);
            var eventBus = new DomainBus();

            eventBus.RegisterHandler(() => new GameHandler(_scoreQuery));
            var eventStorage   = new InMemoryEventStorage();
            var sessionFactory = new SessionFactory(eventStorage);
            var gameService    = new GameService(sessionFactory, eventBus);

            _commandbus = new DomainBus();
            _commandbus.RegisterHandler(() => gameService);
        }
Пример #3
0
        public long GetScore(Map map, Future[] futures)
        {
            var calculator = new SimpleScoreCalculator();

            return(calculator.GetScore(PUNTER_ID, map, futures));
        }