public void Should_detect_when_no_projects_exist()
 {
     //Given that the path already exists;
     var tempPath = GetNewEmptyPathThatExists();
     var bs = new TestAppBootStrapper(tempPath);
     bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.None);
 }
        public void Should_detect_when_multiple_projects_exist_with_correct_count_when_three_and_chosen()
        {
            var tempPath = GetPathWithThreeProjects();
            var bs = new TestAppBootStrapper(tempPath);

            bs.SetProjectName("Project1");
            bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.MultipleChosen);
        }
 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 TestAppBootStrapper(tempPath);
     bootStrapper.CreateRootPathIfNeeded();
     Directory.Exists(tempPath).Should().BeTrue("AppBootStrapper did not create a temp path as expected");
 }
        public void Should_detect_when_single_projects_exist()
        {
            //Given that the path already exists;
            var tempPath = GetNewEmptyPathThatExists();
            // make project folder

            var projectPath = Path.Combine(tempPath, "MyProject");
            Directory.CreateDirectory(projectPath);
            var bs = new TestAppBootStrapper(tempPath);
            bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.Single);
            bs.SetProjectNameToSingle();

            bs.GetProjectBootstrapper("Reports", "Datasources", "Actions").ProjectPath.Should().Be(projectPath);
        }
        public void Should_detect_when_multiple_projects_exist_with_correct_count_when_three_and_chosen_but_doesnt_exist()
        {
            var tempPath = GetPathWithThreeProjects();
            var bs = new TestAppBootStrapper(tempPath);
            Exception exception = null;

            try
            {
                bs.SetProjectName("Project45");
            }
            catch (Exception ex)
            {
                exception = ex;
            }


            exception.Should().NotBeNull();
        }
        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 TestAppBootStrapper(tempPath);

            bs.DetectProjectMode().Should().Be(AppProjectsStructureMode.Single);
            bs.GetProjects().Count().Should().Be(1);
        }