Beispiel #1
0
 /// <summary>
 /// 修正SequenceSessions里后续IDesigntimeSession里的sessionId
 /// 更新SequenceSessions里的键值对
 /// todo 需测试正确性
 /// </summary>
 /// <param name="index"></param>
 private void FixSessionID(int index)
 {
     for (; index < TestProject.SequenceGroups.Count; index++)
     {
         IDesignTimeSession session = SequenceSessions[index + 1];
         session.SessionId = index;
         SequenceSessions.Remove(index + 1);
         SequenceSessions.Add(index, session);
     }
 }
Beispiel #2
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);
        }
Beispiel #3
0
        //todo I18n
        public IDesignTimeSession RemoveSequenceGroup(ISequenceGroup sequenceGroup)
        {
            //在TestProject里找寻sequenceGroup的sessionId
            int sessionId = TestProject.SequenceGroups.IndexOf(sequenceGroup);

            if (sessionId == -1)
            {
                throw new TestflowDataException(ModuleErrorCode.TargetNotExist, "SequenceGroup does not exist in current service");
            }
            IDesignTimeSession designTimeSession = SequenceSessions[sessionId];

            //从SequenceSessions去除
            SequenceSessions.Remove(sessionId);

            //从TestProject去除
            TestProject.SequenceGroups.RemoveAt(sessionId);
            FixSessionID(sessionId);
            return(designTimeSession);
        }