public void Generate_All()
        {
            Clean();
            EnsurePathsExist();

            var files = GetAllYamlFiles();

            var deser = new Deserializer();

            foreach( var file in files )
            {
                //if( !file.Contains("random", StringComparison.OrdinalIgnoreCase) )
                //    continue;//just deal with random for now.
                Console.WriteLine("READING: " + file);
                var sr = new StringReader(File.ReadAllText(file));
                var yamlTest = deser.Deserialize<YamlTest>(sr);

                var mutator = new CSharpTestMutator(yamlTest);
                mutator.MutateTests();


                var outputFile =
                    Path.Combine(OutputDir,
                        Path.GetFileName(
                            Path.ChangeExtension(file, ".cs")));

                Console.WriteLine("OUTPUT: " + outputFile);

                var template = new TestTemplate() {YamlTest = yamlTest};

                File.WriteAllText(outputFile, template.TransformText());
            }
        }
Exemplo n.º 2
0
        public void Generate_All()
        {
            Clean();
            EnsurePathsExist();

            var files = GetAllYamlFiles();

            var deser = new Deserializer();

            foreach (var file in files)
            {
                //if( !file.Contains("random", StringComparison.OrdinalIgnoreCase) )
                //    continue;//just deal with random for now.
                Console.WriteLine("READING: " + file);
                var sr       = new StringReader(File.ReadAllText(file));
                var yamlTest = deser.Deserialize <YamlTest>(sr);

                var mutator = new CSharpTestMutator(yamlTest);
                mutator.MutateTests();


                var outputFile =
                    Path.Combine(OutputDir,
                                 Path.GetFileName(
                                     Path.ChangeExtension(file, ".cs")));

                Console.WriteLine("OUTPUT: " + outputFile);

                var template = new TestTemplate()
                {
                    YamlTest = yamlTest
                };

                File.WriteAllText(outputFile, template.TransformText());
            }
        }