private void generateButton_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            messagesTextBox.Text = String.Format("\r\nStarting Tree Generation for {0}", projectNameTextBox.Text);
            Application.DoEvents();

            var version = getVersion();

            try
            {
                var outputPath =
                    new TreeSurgeonFrontEnd(
                        Path.GetDirectoryName(
                            Assembly.GetExecutingAssembly().Location), version).
                        GenerateDevelopmentTree(projectNameTextBox.Text, getUnitTestName());
                messagesTextBox.Text +=
                    string.Format("\r\nTree Generation complete.\r\nFiles can be found at\r\n{0}", outputPath);
            }
            catch (Exception exc)
            {
                messagesTextBox.Text +=
                    string.Format("\r\nUnhandled Exception thrown. Details follow:\r\n{0}\r\n{1}", exc.Message,
                                  exc.StackTrace);
            }
            Cursor.Current = Cursors.Default;
        }
        public override void Execute(ConsoleApplicationBase consoleApplication, IList<ArgumentInfo> args)
        {
            var options = from arg in args
                        where arg.Type == ArgumentType.Option
                        select arg;

            if(options.Count() < 1 || string.IsNullOrEmpty(ProjectName))
            {
                consoleApplication.PrintHelpMessage();
                return;
            }

            if(!NoLogo)
            {
                consoleApplication.PrintLogo();
            }

            Console.WriteLine("Starting Tree Generation{0}", Environment.NewLine);
            
            Console.WriteLine("       Project Name: \"{0}\"", ProjectName);
            Console.WriteLine("            Version: \"{0}\"", Version);
            Console.WriteLine("Unit Test Framework: \"{0}\"", UnitTestFramework);
            
            Console.WriteLine();

            var frontEnd = new TreeSurgeonFrontEnd(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Version);

            if(Overwrite)
            {
                Directory.Delete(frontEnd.GetOutputPath(ProjectName), true);
            }

            var outputDirectory = frontEnd.GenerateDevelopmentTree(ProjectName, UnitTestFramework);
            Console.WriteLine("Tree Generation complete.{0}{0}Files can be found at:{0}\"{1}\"", Environment.NewLine, outputDirectory);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            _mockDirectoryBuilder = new DynamicMock(typeof (IBuildDirectories));
            _mockGenerator = new DynamicMock(typeof (IGenerateSolutionTrees));
            _treeSurgeonApplicationDirectory = "treeSurgeonDirectory";

            _frontEnd = new TreeSurgeonFrontEnd((IBuildDirectories) _mockDirectoryBuilder.MockInstance,
                                                (IGenerateSolutionTrees) _mockGenerator.MockInstance,
                                                _treeSurgeonApplicationDirectory);
        }