コード例 #1
0
        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));
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        public void assert_is_valid_with_application_base_and_assembly_name_set_should_not_throw()
        {
            var run = new EnvironmentRun()
                      {
                          ApplicationBase = ".",
                          AssemblyName = "SomeAssembly"
                      };

            run.AssertIsValid();
        }
コード例 #4
0
        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");
        }
コード例 #5
0
        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");
        }
コード例 #6
0
        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");
        }
コード例 #7
0
        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();
        }
コード例 #8
0
 public IEnumerable <LogEntry> InstallAndCheckEnvironment(EnvironmentRun run)
 {
     return(execute(run, (i, l) => i.Install(l), (i, l) => i.CheckEnvironment(l)));
 }
コード例 #9
0
        private IEnumerable <LogEntry> execute(EnvironmentRun run, params Action <IInstaller, IPackageLog>[] actions)
        {
            var runner = new EnvironmentRunner(run);

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