Ejemplo n.º 1
0
        public TestCaseExecution AddExecution(string definition, ITestCaseRepository repository, ITestStepFactory factory)
        {
            var timeStamp         = DateTime.Now.ToTimeStamp();
            var testCaseExecution = new TestCaseExecution();

            testCaseExecution.Name  = $"TestCase_{timeStamp}";
            testCaseExecution.Steps = GetTestSteps(definition, factory);

            repository.AddExecution(this.Name, testCaseExecution);
            this.executions.Insert(0, testCaseExecution);

            return(testCaseExecution);
        }
Ejemplo n.º 2
0
        public static TestCaseExecution FromXml(string xml)
        {
            var result = default(TestCaseExecution);

            try
            {
                var xmlSerializer = new XmlSerializer(typeof(TestCaseExecution));
                using (var reader = new StringReader(xml))
                {
                    result = xmlSerializer.Deserialize(reader) as TestCaseExecution;
                }
            }
            catch (Exception ex)
            {
                result       = new TestCaseExecution();
                result.Error = ex.Message;
            }

            return(result);
        }