Пример #1
0
 public TestXml(TestStandaloneXml standalone)
 {
     this.Name = standalone.Name;
     this.DescriptionElement = standalone.DescriptionElement;
     this.IgnoreElement = standalone.IgnoreElement;
     this.Categories = standalone.Categories;
     this.Constraints = standalone.Constraints;
     this.Setup = standalone.Setup;
     this.Cleanup = standalone.Cleanup;
     this.Systems = standalone.Systems;
     this.UniqueIdentifier = standalone.UniqueIdentifier;
     this.Edition = standalone.Edition;
 }
Пример #2
0
        protected internal void Include(Stream stream)
        {
            using (StreamReader reader = new StreamReader(stream, Encoding.UTF8, true))
            {
                var str = reader.ReadToEnd();

                TestStandaloneXml test = null;
                test = XmlDeserializeFromString <TestStandaloneXml>(str);

                test.Content = XmlSerializeFrom <TestStandaloneXml>(test);
                Tests.Add(test);
            }
        }
Пример #3
0
        public IEnumerable <TestXml> Build(List <List <List <object> > > table)
        {
            InitializeTemplate();
            var tests = new List <TestXml>();

            //For each row, we need to fill the variables and render the template.
            int count = 0;

            foreach (var row in table)
            {
                count++;
                var str = BuildTestString(row);

                TestStandaloneXml test = null;
                try
                {
                    test = XmlDeserializeFromString <TestStandaloneXml>(str);
                }
                catch (InvalidOperationException ex)
                {
                    throw new TemplateExecutionException(ex.Message);
                }

                //Cleanup the variables in the template for next iteration.
                foreach (var variable in Variables)
                {
                    Template.Remove(variable);
                }

                test.Content = XmlSerializeFrom <TestStandaloneXml>(test);
                tests.Add(test);
                InvokeProgress(new ProgressEventArgs(count, table.Count()));
            }

            return(tests);
        }
Пример #4
0
 public TestNode(TestStandaloneXml test)
     : base(test.Name) => Content = test;