Exemplo n.º 1
0
 private static void SetInformationXml()
 {
     //_filename = "*.txt";
     string[] filePaths = filePaths = Directory.GetFiles(GetProjectPath(), "*.xml");
     if (filePaths.Length > 0)
     {
         filePaths = Directory.GetFiles(GetProjectPath(), "*.xml");
         _filename = Path.GetFileName(filePaths[0]);
         if (File.Exists(_filename))
         {
             _xmlInfo = new XmlInfo();
             LoadXmlFromFile();
         }
         else
         {
             string text = "Have not found xml file for tests \n" +
                           "Script AutoBuild or tbs-build has errors \n" +
                           "Ask Kotryna for help";
             WriteToTxt(text, _unityLog);
         }
     }
     else
     {
         string text = "Have not found xml file for tests \n" +
                       "Script AutoBuild or tbs-build has errors \n" +
                       "Ask Kotryna for help";
         WriteToTxt(text, _unityLog);
     }
 }
Exemplo n.º 2
0
        private static void ReadXmlFromFile()
        {
            if (_xmlDoc == null)
            {
                return;
            }
            foreach (XmlElement element in _xmlDoc.SelectNodes("test-run"))
            {
                XmlInfo info = new XmlInfo();
                info.amountOfFailedTests = int.Parse(element.GetAttribute("failed"));
                info.amountOfTestsRan    = int.Parse(element.GetAttribute("testcasecount"));
                _xmlInfo = info;
            }

            WriteXmlDataToTxt();
        }
Exemplo n.º 3
0
        private static void ReadXmlForBuild()
        {
            foreach (XmlElement element in _xmlDoc.SelectNodes("test-run"))
            {
                XmlInfo info = new XmlInfo();
                info.amountOfFailedTests = int.Parse(element.GetAttribute("failed"));
                info.amountOfTestsRan    = int.Parse(element.GetAttribute("testcasecount"));
                _xmlInfo = info;
            }
            if (_xmlInfo.amountOfFailedTests > 0)
            {
                WriteToTxt("FAIL", _unityResult);
            }
            else
            {
                WriteToTxt("SUCCESS", _unityResult);
            }

            DeletePreviousXMLFile();
        }