public void KillAgents_Test() { populationManager.CreateInitialPopulation(parent3GenomeSimple, nodeInnovationCounter, connectionInnovationCounter, 100); for (int i = 0; i < resultAgentsInitalizedAgentList.Count; i++) { AgentObject agent = resultAgentsInitalizedAgentList[i]; agent.KillAgent(); Assert.AreEqual(agent, resultAgentKilled); resultAgentKilled = null; //Check if the AllAgentsCallback was invoked after the last agent was killed if (i == resultAgentsInitalizedAgentList.Count - 1) { Assert.True(resultAllAgentsKilled); } else { Assert.False(resultAllAgentsKilled); } } }