public void Should_use_existing_registry_key()
        {
            var helper = new RegistryHelper(subKey);
            var value = helper.AcquireRootPath(junkRegistryValue);

            var value2 = helper.AcquireRootPath("this second value should NOT be persisted to registry");

            value.Should().Be(value2);

        }
        private static bool InitUsingBootstrappers(out ProjectBootStrapper projectBootstrapper)
        {
            projectBootstrapper = null;

            IRootPathAcquirer acquirer = new RegistryHelper(RegistryPath);
            var defaultPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal),
                                           DefaultRootFolderName);

            var bs = new AppBootStrapper(acquirer, defaultPath);

            var mode = bs.DetectProjectMode();

            switch (mode)
            {
                case AppProjectsStructureMode.None:
                    new NoProjectsExistWarning(bs).ShowDialog();
                    return false;
                case AppProjectsStructureMode.MultipleUnchosen:
                    var form = new ChooseProject(bs.GetProjects());
                    form.ShowDialog();

                    if (!String.IsNullOrWhiteSpace(form.SelectedPath))
                        bs.SetProjectName(form.SelectedPath);

                    if (bs.DetectProjectMode() == AppProjectsStructureMode.MultipleUnchosen)
                        return false;
                    break;
                case AppProjectsStructureMode.Single:
                    bs.SetProjectNameToSingle();
                    break;
            }
            var debug = new TraceOutput(DefaultEventAggregator);
            debug.Show();
            projectBootstrapper = bs.GetProjectBootstrapper(ReportsDirectoryName, DataSourceDirectoryName,
                                                                ActionsDirectoryName);


            projectBootstrapper.ExecuteProjectBootStrapperFile(BootStrapperBatchFileName);
            projectBootstrapper.CopyProjectFiles();
            projectBootstrapper.LoadProjectAssemblies();

            ProjectPath = projectBootstrapper.ProjectPath;
            ProjectReportPath = Path.Combine(ProjectPath, ReportsDirectoryName);
            return true;
        }
        public void Should_create_new_registry_key()
        {

            try
            {
                Registry.CurrentUser.DeleteSubKey(subKey);
            }
            catch
            {
            }


            var helper = new RegistryHelper(subKey);
            var value = helper.AcquireRootPath(junkRegistryValue);

            value.Should().Be(junkRegistryValue);

            var key = Registry.CurrentUser.OpenSubKey(subKey);
            key.Should().NotBeNull();
            key.GetValue("ProjectRootPath").Should().Be(junkRegistryValue);
        }