public void Should_Initialize_Agent_From_A_ID() { using( DatabaseDataContext db = new DatabaseDataContext() ) { int agentID = db.Agent_GetBy( null, null ).First().ID; IAgentEngine agent = new AgentEngine(agentID); Assert.IsNotNull(agent.ExecutionManager); Assert.IsNotNull(agent.PluginManager); Assert.Greater(agent.ExecutionManager.Count, 0); Assert.Greater(agent.PluginManager.GetAllocationDefinitions().Count(), 0); } }
private void InitializeAgents() { using( var db = new DatabaseDataContext() ) { foreach( var agentData in db.Agent_GetBy(null,null) ) Broker.Add( new AgentEngine( agentData.ID ) ); PluginLoader.Clear(); foreach( AssemblyInfo info in db.AssemblyInfo_Get( null, null, null, null, null, null, null, true ) ) { if( !PluginLoader.IsAssemblyLoaded( info.Version + ", " + info.Name ) ) PluginLoader.Add( info.Version + ", " + info.Name, info.ReadURL ); // Add AssemblyIdentifier !!!!!!!!!!!!!! } } }