Ejemplo n.º 1
0
        private void CheckIsPass(string result, string msg)
        {
            string stepPass = string.Empty;

            if (result == "true")
            {
                stepPass = "******";
            }
            else if (result == "False")
            {
                stepPass = "******";
            }
            log.Info(string.Format("{0}{1}执行结果:{3}", this.currentTask.Name, this.currentStep.Name, stepPass));
            if (this.currentStep.NextStepId == 99)
            {
                if (!string.IsNullOrEmpty(msg))
                {
                    log.Error("测试完成时未包含吞吐量数据!");
                }
                else
                {
                    string[]    resultValues = msg.Split(',');
                    string[]    limitValues  = this.currentScript.Limit.Split(',');
                    List <bool> PassList     = new List <bool>();
                    for (int i = 0; i < limitValues.Length; i++)
                    {
                        PassList.Add(double.Parse(resultValues[i]) >= double.Parse(limitValues[i]));
                    }
                    if (PassList.Contains(false))
                    {
                        log.Info("吞吐量测试未通过");
                    }
                    else
                    {
                        log.Info("吞吐量测试通过");
                    }
                }
            }
        }