Exemplo n.º 1
0
        public void BeforeEachTest() 
        {
            _subject = new Analyzer();
            _resourceSchedule = new PluginResourceSchedule(1, "test.plugin_resource")
            {
                State = Substitute.For<PluginResourceScheduleState>(_resourceSchedule)
            };

            // load AgentContext
            AgentContext.Load();
            AgentContext.Current.PluginResourceSchedules.Add(_resourceSchedule);
        }
        private PluginResourceSchedule NormalizePluginResourceScheduleData(PluginResourceSchedule schedule)
        {
            if (!string.IsNullOrEmpty(schedule.Option))
            {
                if (schedule.Option == "null")
                {
                    schedule.Option = null;
                }
                else
                {
                    schedule.Option = schedule.Option.Replace("\"", "");
                }
            }

            return schedule;
        }
 public PluginResourceScheduleState(PluginResourceSchedule pluginResourceSchedule)
 {
     Schedule = pluginResourceSchedule;
     CurrentState = StateType.Normal;
 }