public void Should_detect_when_multiple_projects_exist_with_correct_count_when_three_and_chosen()
        {
            var tempPath = GetPathWithThreeProjects();
            var bs = new AppBootStrapper(tempPath);

            bs.SetProjectName("Project1");
            bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.MultipleChosen);
        }
        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");
        }
        static void Main()
        {
            SetupNLog();

            var bs = new AppBootStrapper(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), DefaultRootFolderName));


            var mode = bs.DetectProjectMode();

            switch (mode)
            {
            case AppProjectsStructureMode.None:
                new Popups.NoProjectsExistWarning(bs).ShowDialog();
                return;

            case AppProjectsStructureMode.MultipleUnchosen:
                new Popups.ChooseProject(bs).ShowDialog();
                if (bs.DetectProjectMode() == AppProjectsStructureMode.MultipleUnchosen)
                {
                    return;
                }
                break;
            }

            var projectBootstrapper = bs.GetProjectBootstrapper(ReportsDirectoryName, DataSourceDirectoryName, ActionsDirectoryName);

            projectBootstrapper.CreateFoldersIfNeeded();
            projectBootstrapper.ExecuteBootStrapperBatchFileIfExists(BootStrapperBatchFileName);

            MessageBox.Show("NOT IMPLEMENTED", "Now we can wire this up...");// + bs.GetProjectBootstrapper().ToString());
            return;

            // Runtime Actions
            var runtimeActions = new List <IReportRuntimeAction>()
            {
                new ReportRuntimeAction <XRLabel>(label => label.Name.Contains("gold"), label => label.BackColor = Color.Gold)
            };

            var rootProjectPath = string.Empty;
            List <IReportDatasourceProvider> datasourceProviders = null;

            var designerContext = new DesignerContext(runtimeActions, projectBootstrapper.ReportsFolderPath, rootProjectPath, datasourceProviders);

            Application.Run(designerContext.DesignForm);
        }
        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()
        {
            SetupNLog();

            var bs = new AppBootStrapper(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), DefaultRootFolderName));

            var mode = bs.DetectProjectMode();

            switch (mode)
            {
                    case AppProjectsStructureMode.None:
                    new Popups.NoProjectsExistWarning(bs).ShowDialog();
                    return;
                    case AppProjectsStructureMode.MultipleUnchosen:
                    new Popups.ChooseProject(bs).ShowDialog();
                    if (bs.DetectProjectMode() == AppProjectsStructureMode.MultipleUnchosen)
                        return;
                    break;
            }

            var projectBootstrapper = bs.GetProjectBootstrapper(ReportsDirectoryName,DataSourceDirectoryName,ActionsDirectoryName);

            projectBootstrapper.CreateFoldersIfNeeded();
            projectBootstrapper.ExecuteBootStrapperBatchFileIfExists(BootStrapperBatchFileName);

            MessageBox.Show("NOT IMPLEMENTED", "Now we can wire this up...");// + bs.GetProjectBootstrapper().ToString());
            return;

            // Runtime Actions
            var runtimeActions = new List<IReportRuntimeAction>()
            {
                new ReportRuntimeAction<XRLabel>(label => label.Name.Contains("gold"), label => label.BackColor = Color.Gold)
            };

            var rootProjectPath = string.Empty;
            List<IReportDatasourceProvider> datasourceProviders = null;

            var designerContext = new DesignerContext(runtimeActions, projectBootstrapper.ReportsFolderPath, rootProjectPath, datasourceProviders);

            Application.Run(designerContext.DesignForm);
        }
 public void Should_detect_when_no_projects_exist()
 {
     //Given that the path already exists;
     var tempPath = GetNewEmptyPathThatExists();
     var bs = new AppBootStrapper(tempPath);
     bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.None);
 }