Exemple #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);
        }
        protected override void Before_each_spec()
        {
            mockRepository = new MockRepository();

            var exportList = new List<SourceControl> { sourceControlDouble };

            packageTree = new PackageTreeStub(TreeHelper.GetPackageTreeParts(new List<Dependency>(), exportList), "log4net", false);

            get = new Get(MockRepository.GenerateStub<IFileSystemProvider>());

            packageBuilder = new PackageBuilder(get, new StubProcessFactory(), new CommandArgsDouble("log4net"));
        }
        protected override void Before_each_spec()
        {
            mockRepository = new MockRepository();

            packageTree = TreeHelper.GetTempPackageTree().RetrievePackage(PackageTreeHelper.PackageWithPatch);

            get = MockRepository.GenerateStub<IGet>();

            get.Stub(x => x.From(new SVNSourceControl("url"))).Return(get);

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

            buildMetaData = TreeHelper.GetPackageTreeParts(new List<Dependency>());

            packageBuilder = new PackageBuilderWithOnlyPrebuildStub(get, new DiagnosticsProcessFactory(), new CommandArgsDouble("log4net", true), buildMetaData);
        }
        protected override void Before_each_spec()
        {
            mockRepository = new MockRepository();

            testFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "test.txt");

            DeleteTestFile();

            var cmds = new List<string> { string.Format("@echo \"hello\" > {0}", Path.GetFileName(testFile)) };

            packageTree = new PackageTreeStub(TreeHelper.GetPackageTreeParts(new List<Dependency>(), cmds), "log4net", false);

            get = MockRepository.GenerateStub<IGet>();

            get.Stub(x => x.From(new SVNSourceControl("url"))).Return(get);

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

            packageBuilder = new PackageBuilderStub(get, new DiagnosticsProcessFactory(), new CommandArgsDouble("log4net", true));
        }
        public void Then_The_Builder_Coordinates_The_Build()
        {
            IPackageCommand command = new PackageBuilder(get, new StubProcessFactory(), new CommandArgsDouble("horn"));

            command.Execute(wholeTree);
        }
        protected override void Before_each_spec()
        {
            mockRepository = new MockRepository();

            packageTree = new PackageTreeStub(TreeHelper.GetPackageTreeParts(new List<Dependency>()), "log4net", false);

            get = MockRepository.GenerateStub<IGet>();

            get.Stub(x => x.From(new SVNSourceControl("url"))).Return(get);

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

            packageBuilder = new PackageBuilder(get, MockRepository.GenerateStub<IProcessFactory>(), new CommandArgsDouble("log4net", true));
        }
        protected override void Because()
        {
            packageBuilder = new PackageBuilder(get, MockRepository.GenerateStub<IProcessFactory>(), new CommandArgsDouble("unknownpackage"));

            packageTree = TreeHelper.GetTempPackageTree();
        }