Ejemplo n.º 1
0
        public void FightWithTwoMixedParticipantsIsStarted()
        {
            _fight.AddParticipants(new List <IFightParticipant>
            {
                StubFightParticipant.AlliedFightParticipant(), StubFightParticipant.HostileFightParticipant()
            });

            Assert.IsFalse(_fight.IsFinished());
        }
Ejemplo n.º 2
0
        public void FightWithOneHostileParticipantsEndsImmediately()
        {
            var participants = new List <IFightParticipant> {
                StubFightParticipant.HostileFightParticipant()
            };

            _fight.AddParticipants(participants);

            Assert.IsTrue(_fight.IsFinished());
        }
        public void FightOrchestratorWithOneParticipantsReturnsThatParticipant()
        {
            var participant = new StubFightParticipant();

            _orchestrator.AddParticipants(new List <IFightParticipant> {
                participant
            });

            Assert.AreSame(participant, _orchestrator.GetNextActor());
        }
Ejemplo n.º 4
0
        public void FightWithMixedParticipantsWhereAlliesAreUnconsciousEnds()
        {
            var participants = new List <IFightParticipant>
            {
                StubFightParticipant.AlliedUnconsciousFightParticipant(), StubFightParticipant.HostileFightParticipant()
            };

            _fight.AddParticipants(participants);

            Assert.IsTrue(_fight.IsFinished());
        }
        public void FightWithManyParticipantsReturnsThemInOrderFastestToSlowest()
        {
            var slower = new StubFightParticipant {
                initiative = 1
            };
            var faster = new StubFightParticipant {
                initiative = 2
            };

            _orchestrator.AddParticipants(new List <IFightParticipant> {
                slower, faster
            });

            Assert.AreSame(faster, _orchestrator.GetNextActor());
            Assert.AreSame(slower, _orchestrator.GetNextActor());
            Assert.AreSame(faster, _orchestrator.GetNextActor());
            Assert.AreSame(slower, _orchestrator.GetNextActor());
        }
Ejemplo n.º 6
0
 public void FightWithOnlyHostileParticipantsEndsImmediately()
 {
     _fight.AddParticipants(StubFightParticipant.HostileFightParticipants());
     Assert.IsTrue(_fight.IsFinished());
 }