Exemple #1
0
        public void SelfAttackShouldProduceError()
        {
            var game      = GameMocks.TwoPlayers();
            var processor = CreateProcessor(game);
            var result    = (ErrorEvent)processor.Process(new AttackEvent(1, 1));

            Assert.Equal(Constants.Messages.CannotAttackSelf, result.Message);
        }
        public void HealingShouldBeLimited()
        {
            var game      = GameMocks.TwoPlayers();
            var processor = CreateProcessor(game);
            var result    = (PlayerHealedEvent)processor.Process(new HealingEvent(1, 1));

            Assert.Equal(1, result.PlayerId);
            Assert.Equal(1000, result.Health);
            Assert.Equal(string.Format(Constants.Messages.HealedTemplate, 1, 1), result.Message);
        }
Exemple #3
0
        public void AttackShouldCauseDamage()
        {
            var game      = GameMocks.TwoPlayers();
            var processor = CreateProcessor(game);
            var result    = (PlayerDamagedEvent)processor.Process(new AttackEvent(1, 2));

            Assert.Equal(2, result.PlayerId);
            Assert.InRange(result.Health, 0, 500);
            Assert.StartsWith(string.Format(Constants.Messages.AttackedTemplate, 1, 2), result.Message);
        }