Exemple #1
0
        public void Should_Commit_Plugin()
        {
            IAgentEngine engine = new AgentEngine();
            IPlugin plugin = new TestPlugin();
            IAllocationDefinition definition = new AllocationDefinition(2);

            definition.Add(DTO.NewPluginInfoTestPlugin);

            engine.AddDefinition(definition);

            IPlugin outPlugin = null;
            engine.ExecutionManager.CommitCompleted += delegate(object sender, ObjectEventArgs<IPlugin> eventArgs)
                                                            {
                                                                outPlugin = eventArgs.EventObject;
                                                            };
            engine.Commit(plugin);

            Timing.WaitWhile(() => outPlugin == null, 1000);

            Assert.AreEqual(plugin, outPlugin);
            Assert.AreEqual(PluginStatus.Committed, outPlugin.Status);
        }
Exemple #2
0
        public void Should_Return_True_If_Plugin_Is_Installed()
        {
            IAgentEngine          engine     = new AgentEngine();
            IAllocationDefinition definition = new AllocationDefinition(2);

            definition.Add( DTO.NewPluginInfoTestPlugin );

            engine.AddDefinition( definition );

            Assert.IsTrue( engine.IsPluginInstalled( DTO.NewPluginInfoTestPlugin.PluginIdentifier ) );
        }