public void find_environment_class_by_scanning_assembly_if_no_class_is_specified()
        {
            var run = new EnvironmentRun()
                      {
                          EnvironmentClassName = typeof(FakeEnvironment).AssemblyQualifiedName
                      };

            run.FindEnvironmentType().ShouldEqual(typeof(FakeEnvironment));
        }
        public void assert_is_valid_with_application_base_and_environment_class_name_but_not_assembly()
        {
            var run = new EnvironmentRun()
                      {
                          ApplicationBase = ".",
                          EnvironmentClassName = "some class"
                      };

            run.AssertIsValid();
        }
        public void assert_is_valid_with_application_base_and_assembly_name_set_should_not_throw()
        {
            var run = new EnvironmentRun()
                      {
                          ApplicationBase = ".",
                          AssemblyName = "SomeAssembly"
                      };

            run.AssertIsValid();
        }
        public void assert_is_valid_missing_both_environment_class_name_and_assembly_name_throws()
        {
            var run = new EnvironmentRun(){
                ApplicationBase = "c:\\folder1"
            };

            Exception<EnvironmentRunnerException>.ShouldBeThrownBy(() =>
            {
                run.AssertIsValid();
            }).Message.ShouldContain("Either EnvironmentClassName or AssemblyName must be set");
        }
        public void assert_is_valid_missing_application_base_throws()
        {
            var run = new EnvironmentRun{
                EnvironmentClassName = "some class"
            };

            Exception<EnvironmentRunnerException>.ShouldBeThrownBy(() =>
            {
                run.AssertIsValid();
            }).Message.ShouldContain("ApplicationBase must be a valid folder");
        }
        public void build_app_domain_setup()
        {
            var run = new EnvironmentRun(){
                ApplicationBase = "c:\\folder1",
                ConfigurationFile = "web.config"
            };

            var setup = run.BuildAppDomainSetup();
            setup.ApplicationBase.ShouldEqual(run.ApplicationBase);
            setup.ConfigurationFile.ShouldEqual("c:\\folder1\\web.config");
            setup.ApplicationName.ShouldStartWith("Bottles-Environment-Installation");
            setup.ShadowCopyFiles.ShouldEqual("true");
        }
        public void ForEnvironment([SelectionValues("environments")]string name)
        {
            var className = "{0}.{1}, {0}".ToFormat(typeof (EnvironmentThatBlowsUpInStartUp).Assembly.GetName().Name,
                                                    name);

            var applicationBase = Path.GetFullPath(@"src/FubuTestApplication/bin");

            Debug.WriteLine("Setting the Application Base to " + applicationBase);

            var run = new EnvironmentRun(){
                ApplicationBase = applicationBase,
                EnvironmentClassName = className
            };

            var domain = new EnvironmentGateway(run);
            _installLogs = domain.Install();
            _environmentLogs = domain.CheckEnvironment();
            _allLogs = domain.InstallAndCheckEnvironment();
        }
Esempio n. 8
0
 public IEnumerable <LogEntry> InstallAndCheckEnvironment(EnvironmentRun run)
 {
     return(execute(run, (i, l) => i.Install(l), (i, l) => i.CheckEnvironment(l)));
 }
Esempio n. 9
0
        private IEnumerable <LogEntry> execute(EnvironmentRun run, params Action <IInstaller, IPackageLog>[] actions)
        {
            var runner = new EnvironmentRunner(run);

            return(runner.ExecuteEnvironment(actions));
        }
Esempio n. 10
0
 public EnvironmentRunner(EnvironmentRun run)
 {
     _run = run;
 }
Esempio n. 11
0
 public EnvironmentGateway(EnvironmentRun run)
 {
     _run = run;
 }
Esempio n. 12
0
 public IEnumerable<LogEntry> CheckEnvironment(EnvironmentRun run)
 {
     return execute(run, (i, l) => i.CheckEnvironment(l));
 }
Esempio n. 13
0
 private IEnumerable<LogEntry> execute(EnvironmentRun run, params Action<IInstaller, IPackageLog>[] actions)
 {
     var runner = new EnvironmentRunner(run);
     return runner.ExecuteEnvironment(actions);
 }
Esempio n. 14
0
 public IEnumerable<LogEntry> Install(EnvironmentRun run)
 {
     return execute(run, (i, l) => i.Install(l));
 }
Esempio n. 15
0
 public EnvironmentRunner(EnvironmentRun run)
 {
     _run = run;
 }
Esempio n. 16
0
 public EnvironmentGateway(EnvironmentRun run)
 {
     _run = run;
 }