Exemplo n.º 1
0
        /// <summary>
        /// Converts the testcase to a ALM Octane 'script' parameter for a API upload
        /// </summary>
        /// <param name="test"></param>
        /// <returns></returns>
        public string ConvertToString(TestCase test)
        {
            ExcelExport   exp   = new ExcelExport();
            var           steps = exp.CreateALMTestStep(test.TestSteps);
            StringBuilder sb    = new StringBuilder();

            // Append the first test step then ...
            sb.Append("- " + steps[0].Item1);
            if (!string.IsNullOrEmpty(steps[0].Item2))
            {
                sb.Append(steps[0].Item2);
            }
            // ... go into the main loop
            for (int i = 1; i < steps.Count; i++)
            {
                sb.Append("\n- " + steps[i].Item1);
                if (!string.IsNullOrEmpty(steps[i].Item2))
                {
                    sb.Append("\n- ?" + steps[i].Item2);
                }
            }
            return(sb.ToString());
        }