public void ShouldChooseBattleDetails() { var t = new Tournament(); t.Populate(); t.Start(); var battleDetails = t.GetNextBattleDetails(); Assert.IsNotNull(battleDetails); }
public void ShouldReturnNullBattleForUnmatchedGuid() { var t = new Tournament(); t.Populate(); t.Start(); var guid = Guid.NewGuid(); Assert.IsNull(t.GetBattleByGuid(guid)); }
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 ShouldMakeSureParticipantNamesUnique() { var t = new Tournament(); var c = new Dumbass(); c.SetName("Idiot"); t.AddCharacterToTournament(c); var d = new Dumbass(); d.SetName("Idiot"); t.AddCharacterToTournament(d); Assert.IsTrue(t.Participants.Count == 2 && t.Participants.Count(i => i.Character.Name == "Idiot") == 1); }
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(); }
public void ShouldPopulateTournamentWithBots() { var t = new Tournament(); t.Populate(); Assert.IsTrue(t.Participants.Count == 128); }