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); }
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); }
public long GetScore(Map map, Future[] futures) { var calculator = new SimpleScoreCalculator(); return(calculator.GetScore(PUNTER_ID, map, futures)); }