Exemple #1
0
        public void PlayerShouldNotJoinToOvercrowdedGame()
        {
            var game       = GameMocks.Overcrowded();
            var processor  = new JoinEventProcessor(game.Object, new MockLogger());
            var errorEvent = (ErrorEvent)processor.Process(new JoinEvent());

            Assert.Equal(Constants.Messages.GameOvercrowded, errorEvent.Message);
        }
Exemple #2
0
        public void PlayerShouldJoin()
        {
            var game        = GameMocks.Joinable();
            var processor   = new JoinEventProcessor(game.Object, new MockLogger());
            var joinedEvent = (PlayerJoinedEvent)processor.Process(new JoinEvent());

            Assert.NotNull(joinedEvent.Player);
        }