public void AddCreatures_WhenIdentifierIsNull_ShouldThrowException()
        {
            var mockedCreaturesFactory = new Mock<ICreaturesFactory>();
            var mockedLogger = new Mock<ILogger>();

            var mockedBattleManager = new MockedBattleManager(mockedCreaturesFactory.Object, mockedLogger.Object);

            Assert.Throws<ArgumentNullException>(() => mockedBattleManager.AddCreatures(null, 5));
        }
        public void Attack_WhenArmyNumbersAreEqual_ShouldThrowException()
        {
            var mockedCreaturesFactory = new Mock<ICreaturesFactory>();
            var mockedLogger = new Mock<ILogger>();

            var mockedBattleManager = new MockedBattleManager(mockedCreaturesFactory.Object, mockedLogger.Object);

            var attackerIdentifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)");
            var defenderIdentifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)");

            var creature = new Angel();

            mockedCreaturesFactory.Setup(x => x.CreateCreature(It.IsAny<string>())).Returns(creature);

            mockedLogger.Setup(x => x.WriteLine(It.IsAny<string>()));

            mockedBattleManager.AddCreatures(attackerIdentifier, 1);
            mockedBattleManager.AddCreatures(defenderIdentifier, 1);

            Assert.Throws<ArgumentException>(() => mockedBattleManager.Attack(attackerIdentifier, defenderIdentifier));
        }
        public void Attack_WhenIdentifiersAreValid_ShouldWorkCorrectly()
        {
            var mockedCreaturesFactory = new Mock<ICreaturesFactory>();
            var mockedLogger = new Mock<ILogger>();

            var mockedBattleManager = new MockedBattleManager(mockedCreaturesFactory.Object, mockedLogger.Object);

            var attackerIdentifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(1)");
            var defenderIdentifier = CreatureIdentifier.CreatureIdentifierFromString("Angel(2)");

            var creature = new Angel();

            mockedCreaturesFactory.Setup(x => x.CreateCreature(It.IsAny<string>())).Returns(creature);

            mockedLogger.Setup(x => x.WriteLine(It.IsAny<string>()));

            mockedBattleManager.AddCreatures(attackerIdentifier, 1);
            mockedBattleManager.AddCreatures(defenderIdentifier, 1);

            mockedBattleManager.Attack(attackerIdentifier, defenderIdentifier);

            mockedLogger.Verify(x => x.WriteLine(It.IsAny<string>()), Times.Exactly(6));
        }