Esempio n. 1
0
        private Agent.Agent GetDefaultAgent()
        {
            var config = AgentConfiguration.GetDefault();

            config.Strategy = -1; //DoNothingStrategy
            return(GetInitializedAgent(config));
        }
Esempio n. 2
0
        public void AcceptMessage_ShouldNotJoinWnehRejected()
        {
            var config = AgentConfiguration.GetDefault();

            agent            = new Agent.Agent(config);
            agent.AgentState = AgentState.WaitingForJoin;
            agent.AcceptMessage(GetBaseMessage(new JoinResponse(false, 1), 1));
            Assert.AreEqual(agent.AgentState, AgentState.WaitingForJoin);
        }
Esempio n. 3
0
        public void AcceptMessage_ShouldJoinWhenAccepted()
        {
            var config = AgentConfiguration.GetDefault();

            agent            = new Agent.Agent(config);
            agent.AgentState = AgentState.WaitingForJoin;
            agent.AcceptMessage(GetBaseMessage(new JoinResponse(true, 1), 1));
            Assert.AreEqual(agent.AgentState, AgentState.WaitingForStart);
        }
        private void GetConfigurationsForTest(int testId, out AgentConfiguration agentConfig, out GameMasterConfiguration gmConfig, out CommunicationServerConfiguration csConfig)
        {
            const int baseAgentPort = 50000;
            const int baseGmPort    = 60000;

            var agentPortForTest = baseAgentPort + testId;
            var gmPortForTest    = baseGmPort - testId;

            csConfig = CommunicationServerConfiguration.GetDefault();

            agentConfig        = AgentConfiguration.GetDefault();
            agentConfig.CsPort = agentPortForTest;
            csConfig.AgentPort = agentPortForTest;

            gmConfig                = GameMasterConfiguration.GetDefault();
            gmConfig.CsPort         = gmPortForTest;
            csConfig.GameMasterPort = gmPortForTest;
        }
Esempio n. 5
0
 public void Setup()
 {
     agent                = GetDefaultAgent();
     startTime            = DateTime.Now;
     defaultConfiguration = AgentConfiguration.GetDefault();
 }