Пример #1
0
        protected override void Before_each_spec()
        {
            textWriter = new StringWriter();

            var parser = new SwitchParser(textWriter, args);

            packageTree = TreeHelper.GetTempPackageTree();

            var dependencyResolver = CreateStub<IDependencyResolver>();

            sourceControl = new SourceControlDouble("http://someurl.com");

            dependencyResolver.Stub(x => x.Resolve<IBuildConfigReader>()).Return(new BooBuildConfigReader());

            dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(sourceControl);

            IoC.InitializeWith(dependencyResolver);

            get = MockRepository.GenerateStub<IGet>();

            get.Stub(x => x.From(sourceControl)).Return(get);

            get.Stub(x => x.ExportTo(packageTree)).Return(packageTree);

            packageBuilder = new PackageBuilderStub(get, MockRepository.GenerateStub<IProcessFactory>(), parser.CommandArguments);
        }
Пример #2
0
        static void Main(string[] args)
        {
            log.Debug("Horn starting.........");

            XmlConfigurator.Configure();

            var output = new StringWriter();

            var parser = new SwitchParser(output, args);

            if(!parser.IsAValidRequest())
            {
                log.Error(output.ToString());
                return;
            }

            InitialiseIoC(parser.CommandArguments);

            var packageTree = IoC.Resolve<IPackageTree>().GetRootPackageTree(GetRootFolderPath(parser.CommandArguments));

            try
            {
                IoC.Resolve<IPackageCommand>(parser.ParsedArgs.First().Key).Execute(packageTree);
            }
            catch (UnknownInstallPackageException unpe)
            {
                log.Info(unpe.Message);
            }
            catch (BuildFailedException bfe)
            {
                log.Info(bfe.Message);
            }
            catch(RemoteScmException scm)
            {
                log.Info(scm.Message);
            }
            catch(EnvironmentVariableNotFoundException eve)
            {
                log.Info(eve.Message);
            }
            catch (MissingBuildFileException mbfe)
            {
                log.Info(mbfe.Message);
            }
        }
Пример #3
0
        protected override void Because()
        {
            parser = new SwitchParser(Output, Args);

            IsValid = parser.IsAValidRequest();
        }
Пример #4
0
        protected override void Because()
        {
            parser = new SwitchParser(Output, args);

            IsValid = parser.IsValid();
        }
Пример #5
0
 protected override void Because()
 {
     parser = new SwitchParser(Output, args);
 }