Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
        //todo SetUp/TearDown = null
        public void Unload()
        {
            this.TestProject = null; // need to load

            SequenceSessions = new Dictionary <int, IDesignTimeSession>();
            Components       = new Dictionary <string, IComInterfaceDescription>();

            SetUpSession    = null;
            TearDownSession = null;
        }
Exemplo n.º 3
0
        //todo SetUp/TearDown = null
        public DesignTimeService()
        {
            this.TestProject = null; // need to load

            SequenceSessions = new Dictionary <int, IDesignTimeSession>();
            Components       = new Dictionary <string, IComInterfaceDescription>();

            I18NOption i18NOption = new I18NOption(this.GetType().Assembly, "i18n_designService_zh",
                                                   "i18n_designService_en")
            {
                Name = Constants.I18nName
            };

            I18N.InitInstance(i18NOption);

            SetUpSession    = null;
            TearDownSession = null;
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
 public IDesignTimeSession RemoveSequenceGroup(IDesignTimeSession designTimeSession)
 {
     return(RemoveSequenceGroup(designTimeSession.Context.SequenceGroup));
 }