public void InitBattle_InvalidCombatants() { // arrange List<Combatant> combatants = new List<Combatant>(); Combatant combatant1Copy = CopyCombatant(combatant1); Combatant deadCombatant1Copy = CopyCombatant(deadCombatant1); combatants.Add(combatant1Copy); combatants.Add(deadCombatant1Copy); Battle battleClass = new Battle(); // act battleClass.InitBattle(combatants); }
public void InitBattle_TestBattleOutputCombatLog() { // NOTICE: This test only tests the output of a battle // For each individual part of the battle, check the other tests! // arrange List<Combatant> combatants = new List<Combatant>(); Combatant combatant1Copy = CopyCombatant(combatant1); Combatant combatant2Copy = CopyCombatant(combatant2); // to prevent the battlesystem to search the database for the combatants combatant1Copy.UserID = null; combatant2Copy.UserID = null; combatant1Copy.CombatantID = 0; combatant2Copy.CombatantID = 0; combatants.Add(combatant1Copy); combatants.Add(combatant2Copy); Battle battleClass = new Battle(); // act try { battleClass.InitBattle(combatants); List<CombatLog> combatLog = battleClass.GetCombatLog(); // print the combatlog to test output for (int i = 0; i < combatLog.Count; i++) { System.Diagnostics.Trace.WriteLine(String.Format("LogEntry: {0} DefenderDamage: {1} AttackerDamage: {2}", combatLog[i].Text, combatLog[i].DefenderDamage, combatLog[i].AttackerDamage)); } } catch (Exception ex) { // assert Assert.Fail("Something prohibited the battle from finishing. ErrorMsg: {0}", ex.Message); return; } Assert.IsTrue(true); }