コード例 #1
0
 public void TestNodeContainerIterator_RemoveAlreadyRemovedNode()
 {
     AgentDTO agent = new AgentDTO() { ID = 1, Name = "NAgent1", Territory = "North" };
     ///Remove a node
     agentContainerIterator.RemoveNode(agent);
     ///Try removing again
     Assert.AreEqual(false, agentContainerIterator.RemoveNode(agent));
 }
コード例 #2
0
 public void TestNodeContainerIterator_AddAndScheduleNode()
 {
     AgentDTO newAgent = new AgentDTO() { ID = 2, Name = "NAgent2", Territory = "North" };
     agentContainerIterator.AddNode(newAgent);
     ///Schedule the node
     agentContainerIterator.MoveNext();
     Assert.AreEqual(newAgent, agentContainerIterator.PreviousNode());
 }
コード例 #3
0
 public void TestNodeContainerIterator_RemoveNode()
 {
     AgentDTO agentToRemove = new AgentDTO() { ID = 1, Name = "NAgent1", Territory = "North" };
     Assert.AreEqual(true, agentContainerIterator.RemoveNode(agentToRemove));
 }
コード例 #4
0
 public void TestNodeContainerIterator_AddNode()
 {
     AgentDTO newAgent = new AgentDTO() { ID = 2, Name = "NAgent2", Territory = "North" };
     agentContainerIterator.AddNode(newAgent);
     Assert.AreEqual(newAgent, agentContainerIterator.PeekCurrent());
 }
コード例 #5
0
 public void Initialize()
 {
     agentContainerIterator = new LIFONodeContainerIterator<AgentDTO>();
     AgentDTO newAgent = new AgentDTO() { ID = 1, Name = "NAgent1", Territory = "North" };
     agentContainerIterator.AddNode(newAgent);
 }
コード例 #6
0
 public void TestLeadDistribution_RemoveAgent()
 {
     ///Try Removing an agent
     AgentDTO availableAgent = new AgentDTO() { ID = 1, Name = "NAgent1", Territory = "North" };
     Assert.AreEqual(true, service.RemoveAgent(availableAgent));
 }