public void ShouldReturnNullBattleForUnmatchedGuid() { var t = new Tournament(); t.Populate(); t.Start(); var guid = Guid.NewGuid(); Assert.IsNull(t.GetBattleByGuid(guid)); }
public void ShouldChooseBattleDetails() { var t = new Tournament(); t.Populate(); t.Start(); var battleDetails = t.GetNextBattleDetails(); Assert.IsNotNull(battleDetails); }
public void ShouldAssignHealthAndSkillTreeWhenStartingTournament() { var t = new Tournament(); t.Populate(); t.Start(); Assert.IsTrue(t.Participants.TrueForAll(i => i.Character.Health > 0)); Assert.IsTrue(t.Participants.Exists(i => i.Character.SkillTree.Get().ToList().Exists(s => s is PathOfTheFighter && s.IsActive))); Assert.IsTrue(t.Participants.Exists(i => i.Character.SkillTree.Get().ToList().Exists(s => s is PathOfTheWizard && s.IsActive))); }
public void ShouldReturnBattleByGuid() { var t = new Tournament(); t.Populate(); t.Start(); var guid = t.BattlesByRound[t.Round].First().BattleGuid; var battle = t.GetBattleByGuid(guid); Assert.IsNotNull(battle); Assert.IsTrue(battle.BattleGuid == guid); }
public void ShouldThrowExceptionIfTournamentStartedWithoutEnoughValidParticipants() { var t = new Tournament(); var c1 = new Dumbass(); c1.SetName("1"); t.Participants.Add(new Participant { Battles = 5, Character = c1, Status = ParticipantStatus.Active }); var c2 = new Dumbass(); c2.SetName("2"); t.Participants.Add(new Participant { Battles = 1, Character = c2, Status = ParticipantStatus.KnockedOut }); t.Start(); }