public TestsGenerator(int maxReadersCount, int maxGeneratorsCount, int maxWritersCount, string outputDir)
 {
     this.maxGeneratorsCount = maxGeneratorsCount;
     this.maxReadersCount    = maxReadersCount;
     this.maxWritersCount    = maxWritersCount;
     writer = new TestWriter(outputDir);
     reader = new TestReader();
 }
 public TestsGenerator(int maxReadersCount, int maxGeneratorsCount,
                       int maxWritersCount, ITestWriter writer, ITestReader reader)
 {
     this.maxGeneratorsCount = maxGeneratorsCount;
     this.maxReadersCount    = maxReadersCount;
     this.maxWritersCount    = maxWritersCount;
     this.writer             = writer;
     this.reader             = reader;
 }
        public void Init()
        {
            outputDirectory = Path.Combine("..", "..", "TestDirectoryOutput");
            inputDirectory  = Path.Combine("..", "..", "TestDirectoryInput");

            writer    = new TestWriter(outputDirectory);
            reader    = new TestReader();
            generator = new TestsGenerator(1, 1, 1, writer, reader);
            generator.Generate(Directory.GetFiles(inputDirectory).ToList()).Wait();

            generatedUnit = ParseCompilationUnit(File.ReadAllText(Path.Combine(outputDirectory, "TestClasses.cs")));
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnitTestGenerationCommand"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        /// <param name="commandService">Command service to add command to, not null.</param>
        private UnitTestGenerationCommand(AsyncPackage package, OleMenuCommandService commandService)
        {
            _package       = package ?? throw new ArgumentNullException(nameof(package));
            commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));

            _syntaxTreeFactory = new SyntaxTreeFactory();
            _classParser       = new ClassParser();
            _testWriter        = new TestWriter();

            var menuCommandId = new CommandID(CommandSet, CommandId);
            var menuItem      = new OleMenuCommand(Execute, menuCommandId);

            commandService.AddCommand(menuItem);
        }
示例#5
0
 public TestConverter(ITestReader reader, ITestWriter writer)
 {
     _reader = reader;
     _writer = writer;
 }
示例#6
0
 public TestConverter(ITestReader reader, ITestWriter writer)
 {
     _reader = reader;
     _writer = writer;
 }