public MainWindow() { InitializeComponent(); AppBootstrapper = new AppBootStrapper(); DataContext = AppBootstrapper; }
public NoProjectsExistWarning(AppBootStrapper bootStrapper) : this() { _bootStrapper = bootStrapper; memoEdit1.Text = memoEdit1.Text.Replace("@PATH", bootStrapper.RootPath); }
public ChooseProject(AppBootStrapper bootStrapper) : this() { _bootStrapper = bootStrapper; this.multipleProjectsListBoxControl.DataSource = _bootStrapper.GetProjects().ToArray(); }
public void Should_detect_when_multiple_projects_exist_with_correct_count_when_three() { var tempPath = GetPathWithThreeProjects(); var bs = new AppBootStrapper(tempPath); bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.MultipleUnchosen); bs.GetProjects().Count().Should().Be(3); }
public void Should_detect_when_no_path_projects_exist() { //Given that the path already exists; var tempPath = GetNewEmptyPathThatDoesntExists(); var bs = new AppBootStrapper(tempPath); bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.None); }
public void Should_detect_when_multiple_projects_exist_with_correct_count_when_one() { var tempPath = GetNewEmptyPathThatExists(); Directory.CreateDirectory(Path.Combine(tempPath, "Project1")); var bs = new AppBootStrapper(tempPath); bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.Single); bs.GetProjects().Count().Should().Be(1); }
public void Should_auto_create_folder() { var tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); Directory.Exists(tempPath).Should().BeFalse("Test is in invalid state, cannot proceed"); var bootStrapper = new AppBootStrapper(tempPath); bootStrapper.CreateRootPathIfNeeded(); Directory.Exists(tempPath).Should().BeTrue("AppBootStrapper did not create a temp path as expected"); }
public void Should_detect_when_multiple_projects_exist_with_correct_count_when_three_and_chosen_but_doesnt_exist() { var tempPath = GetPathWithThreeProjects(); var bs = new AppBootStrapper(tempPath); Exception exception = null; try { bs.SetProjectName("Project45"); } catch (Exception ex) { exception = ex; } exception.Should().NotBeNull(); }
static void Main() { IServiceContainer container = new AppBootStrapper().CreateApplicationContainer(); try { container.Bootstrap <ConsoleBootstrapper>(); var logger = container.Resolve <ILogger>(); try { container.Resolve <IApplicationEntryPoint>().Execute(); } catch (Exception ex) when(!Debugger.IsAttached) { logger.Error($"{ex.GetType().Name}: {ex.Message}"); if (ex.StackTrace != null) { logger.Error(ex.StackTrace); } Environment.Exit(1); } } catch (Exception ex) when(!Debugger.IsAttached) { System.Console.WriteLine($"{ex.GetType().Name}: {ex.Message}"); if (ex.StackTrace != null) { System.Console.WriteLine(ex.StackTrace); } Environment.Exit(1); } }
public App() { BootStrapper = new AppBootStrapper(); }