예제 #1
0
        public IDesignTimeSession AddSequenceGroup(ISequenceGroup sequenceGroup)
        {
            int index = TestProject.SequenceGroups.Count;

            //添加到TestProject
            TestProject.SequenceGroups.Add(sequenceGroup);
            foreach (IComInterfaceDescription comDescription in _interfaceManager.GetComponentInterfaces(sequenceGroup.Assemblies))
            {
                AddComponent(comDescription);
            }
            //添加到SequenceSessions
            IDesignTimeSession designtimeSession = new DesignTimeSession(index, sequenceGroup);

            SequenceSessions.Add(index, designtimeSession);
            return(designtimeSession);
        }
예제 #2
0
        /// <summary>
        /// 校验SequenceGroup内模块的参数配置正确性
        /// </summary>
        /// <param name="sequenceGroup">待校验的序列组</param>
        /// <returns>检查过程中出现的告警信息</returns>
        public IList <IWarningInfo> CheckParameters(ISequenceGroup sequenceGroup, bool overwriteType)
        {
            _comInterfaceManager.GetComponentInterfaces(sequenceGroup.Assemblies);
            IList <IWarningInfo> warnList = new List <IWarningInfo>();

            #region 检查setUp
            IList <IWarningInfo> setUpWarnList = CheckSteps(sequenceGroup.SetUp.Steps, overwriteType, new ISequenceFlowContainer[] { sequenceGroup.SetUp, sequenceGroup });
            foreach (IWarningInfo warnInfo in setUpWarnList)
            {
                warnInfo.Sequence      = sequenceGroup.SetUp;
                warnInfo.SequenceGroup = sequenceGroup;
            }
            warnList = warnList.Concat(setUpWarnList).ToList();
            #endregion

            #region 检查teardown
            IList <IWarningInfo> tearDownWarnList = CheckSteps(sequenceGroup.TearDown.Steps, overwriteType, new ISequenceFlowContainer[] { sequenceGroup.TearDown, sequenceGroup });
            foreach (IWarningInfo warnInfo in tearDownWarnList)
            {
                warnInfo.Sequence      = sequenceGroup.TearDown;
                warnInfo.SequenceGroup = sequenceGroup;
            }
            warnList = warnList.Concat(tearDownWarnList).ToList();
            #endregion

            #region 检查sequence
            foreach (ISequence sequence in sequenceGroup.Sequences)
            {
                IList <IWarningInfo> sequenceWarnList = CheckSteps(sequence.Steps, overwriteType, new ISequenceFlowContainer[] { sequence, sequenceGroup });
                foreach (IWarningInfo warnInfo in sequenceWarnList)
                {
                    warnInfo.Sequence      = sequence;
                    warnInfo.SequenceGroup = sequenceGroup;
                }
                warnList = warnList.Concat(sequenceWarnList).ToList();
            }
            #endregion

            return(warnList);
        }