예제 #1
0
 public testlink(ILog log)
 {
     this.log = log;
     tree[0] = new testsuite();
     apikey = ConfigurationManager.AppSettings["tl_apikey"];
     uri = ConfigurationManager.AppSettings["tl_xmlrpc_url"];
     //  testsuite template = testsuite.LoadFromFile(Environment.CurrentDirectory + "\\template.xml");
 }
예제 #2
0
        public testsuite addItems(int deep, string id, string summary)
        {
            testsuite ts = new testsuite();
            ts.name = id;
            ts.details = summary;
            ts.node_order = ++node_order[deep];
            tree[deep-1].Items.Add(ts);
            tree[deep] = ts;

            for (int i = deep+1; i < 5; i++) {
                node_order[i] = 0;
            }
            return ts;
        }
예제 #3
0
 public int tc_cnt(testsuite ts)
 {
     List<object> items=ts.Items;
     int cnt=0;
     for (int i = 0; i < items.Count; i++) {
         if (items[i] is testsuite)
             cnt += tc_cnt((testsuite)items[i]);
         else
         {
             cnt++;
         }
     }
     return cnt;
 }
 public static bool LoadFromFile(string fileName, out testsuite obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an testsuite object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output testsuite object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out testsuite obj, out System.Exception exception)
 {
     exception = null;
     obj = default(testsuite);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string xml, out testsuite obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an testsuite object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output testsuite object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out testsuite obj, out System.Exception exception)
 {
     exception = null;
     obj = default(testsuite);
     try
     {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }