Esempio n. 1
0
        public TestSessionLogXmlAssert(string xml)
        {
            _xml            = xml;
            _testSessionLog = DeserializeXml(xml);

            TestSessionLogXmlValidator.Validate(xml);
        }
Esempio n. 2
0
 private static string CreateXml(testSessionLog log)
 {
     StringWriter sw = new StringWriter();
     XmlSerializer xml = new XmlSerializer(typeof(testSessionLog));
     xml.Serialize(sw, log);
     return sw.ToString();
 }
Esempio n. 3
0
        public void GenerateXmlAndSaveToFile(TestSession testSession)
        {
            string pathToLogFile = testSession.Archive.WorkingDirectory.RepositoryOperations()
                .WithFile(ArkadeConstants.ArkadeXmlLogFileName)
                .FullName;

            testSessionLog log = GetTestSessionLog(testSession);
            FileStream fs = new FileStream(pathToLogFile, FileMode.Create);

            XmlSerializer xmls = new XmlSerializer(typeof(testSessionLog));
            xmls.Serialize(fs, log);
            fs.Close();
        }
Esempio n. 4
0
        private static testSessionLog GetTestSessionLog(TestSession testSession)
        {
            testSessionLog log = new testSessionLog();
            log.timestamp = DateTime.Now;
            log.arkadeVersion = ArkadeVersion.Current;

            log.archiveType = testSession?.Archive?.ArchiveType.ToString();
            log.archiveUuid = testSession?.Archive?.Uuid?.GetValue();

            log.logEntries = GetLogEntries(testSession);
            log.testResults = GetTestResults(testSession);

            return log;
        }