コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            AppBootstrapper = new AppBootStrapper();
            DataContext = AppBootstrapper;
        }
コード例 #2
0
        public NoProjectsExistWarning(AppBootStrapper bootStrapper)
            : this()
        {
            _bootStrapper = bootStrapper;

            memoEdit1.Text = memoEdit1.Text.Replace("@PATH", bootStrapper.RootPath);
        }
コード例 #3
0
        public ChooseProject(AppBootStrapper bootStrapper)
            : this()
        {
            _bootStrapper = bootStrapper;

            this.multipleProjectsListBoxControl.DataSource = _bootStrapper.GetProjects().ToArray();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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");
        }
コード例 #8
0
        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();
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: lassevk/mas
        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);
            }
        }
コード例 #10
0
        public NoProjectsExistWarning(AppBootStrapper bootStrapper) : this()
        {
            _bootStrapper = bootStrapper;

            memoEdit1.Text = memoEdit1.Text.Replace("@PATH", bootStrapper.RootPath);
        }
コード例 #11
0
 public App()
 {
     BootStrapper = new AppBootStrapper();
 }
コード例 #12
0
        public ChooseProject(AppBootStrapper bootStrapper) : this()
        {
            _bootStrapper = bootStrapper;

            this.multipleProjectsListBoxControl.DataSource = _bootStrapper.GetProjects().ToArray();
        }