static void Main(string[] args) { int readingTasksCount = Convert.ToInt32(args[0]); int writingTasksCount = Convert.ToInt32(args[1]); TestGeneratorConfig config = new TestGeneratorConfig(readingTasksCount, writingTasksCount); string outputDirectory = args[2]; List <string> paths = new List <string>(); for (int i = 3; i < args.Length; i++) { paths.Add(args[i]); } CodeReader reader = new CodeReader(); CodeWriter writer = new CodeWriter(outputDirectory); TestsGenerator generator = new TestsGenerator(config); generator.Generate(reader, writer, paths).Wait(); Console.WriteLine("Done!"); Console.ReadLine(); }
public void SetUp() { _readingTasksCount = 3; _writingTasksCount = 3; _config = new TestGeneratorConfig(_readingTasksCount, _writingTasksCount); _outputDirectory = "./"; _paths = new List <string>(); _paths.Add("./AnotherClass.csSource"); _paths.Add("./SomeClass.csSource"); _reader = new CodeReader(); _writer = new CodeWriter(_outputDirectory); _generator = new TestsGenerator(_config); _generator.Generate(_reader, _writer, _paths).Wait(); _programmText = File.ReadAllText("./SomeClassTests.cs"); SyntaxTree syntaxTree; syntaxTree = CSharpSyntaxTree.ParseText(_programmText); _compilationUnitSyntax = syntaxTree.GetCompilationUnitRoot(); }
static void Main(string[] args) { int readingLimit = 5; int writingLimit = 5; int processingLimit = 10; string workPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "\\TestsFiles\\"; List <string> pathes = new List <string> { workPath + "MyClass.cs", workPath + "Tracer.cs" }; TestGeneratorConfig config = new TestGeneratorConfig(readingLimit, processingLimit, writingLimit); TestsGenerator generator = new TestsGenerator(config); generator.Generate(pathes, workPath + "GeneratedTests").Wait(); }
public void SetUp() { int readingLimit = 3, writingLimit = 3, processingLimit = 8; string sourceCode; string workPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "\\TestsFiles\\"; SyntaxTree codeTree; List <string> pathes = new List <string>(); TestGeneratorConfig config; TestsGenerator generator; pathes.Add(workPath + "MyClass.cs"); config = new TestGeneratorConfig(readingLimit, processingLimit, writingLimit); generator = new TestsGenerator(config); generator.Generate(pathes, workPath + "GeneratedTests").Wait(); sourceCode = File.ReadAllText(workPath + "GeneratedTests\\MyClassTest.dat"); codeTree = CSharpSyntaxTree.ParseText(sourceCode); root = codeTree.GetCompilationUnitRoot(); }