当前位置: 首页>>代码示例>>C#>>正文


C# IPackageTree.Stub方法代码示例

本文整理汇总了C#中IPackageTree.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IPackageTree.Stub方法的具体用法?C# IPackageTree.Stub怎么用?C# IPackageTree.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPackageTree的用法示例。


在下文中一共展示了IPackageTree.Stub方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRootPath

        protected string GetRootPath()
        {
            outputPath = CreateDirectory("Output");

            workingPath = CreateDirectory("Working");

            packageTree = MockRepository.GenerateStub<IPackageTree>();

            packageTree.Stub(x => x.OutputDirectory).Return(new DirectoryInfo(outputPath));

            packageTree.Stub(x => x.Result).Return(new DirectoryInfo(outputPath));

            var executionBase = AppDomain.CurrentDomain.BaseDirectory;

            return ResolveRootPath(executionBase);
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:16,代码来源:BuildSpecificationBase.cs

示例2: Because

        protected override void Because()
        {
            rootBuildMetaData = CreateStub<IBuildMetaData>();
            dependencyBuildMetaData = CreateStub<IBuildMetaData>();

            rootBuildMetaData.BuildEngine = new BuildEngine(new BuildToolStub(), "root.boo", Utils.Framework.FrameworkVersion.FrameworkVersion35, CreateStub<IDependencyDispatcher>());
            rootBuildMetaData.BuildEngine.Dependencies.Add(new Dependency("simpleDependency", "simpleDependency"));
            dependencyBuildMetaData.BuildEngine = new BuildEngine(new BuildToolStub(), "simpleDependency", Utils.Framework.FrameworkVersion.FrameworkVersion35, CreateStub<IDependencyDispatcher>());

            packageTree = CreateStub<IPackageTree>();
            packageTree.Stub(x => x.Name).Return("root");
            packageTree.Stub(x => x.GetBuildMetaData("root")).Return(rootBuildMetaData);

            dependentTree = new NullPackageTree();

            packageTree.Stub(x => x.RetrievePackage(new Dependency("dependency", "dependency"))).IgnoreArguments().Return(dependentTree);
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:17,代码来源:DependencyTreeSpecification.cs

示例3: Because

        protected override void Because()
        {
            get = new Get(fileSystemProvider);

            IBuildMetaData buildMetaData;

            IPackageTree componentTree = GetComponentTree(out buildMetaData);

            wholeTree = CreateStub<IPackageTree>();

            wholeTree.Stub(x => x.Name).Return("horn");

            wholeTree.Stub(x => x.BuildNodes()).Return(new List<IPackageTree> {wholeTree});

            wholeTree.Stub(x => x.RetrievePackage(CommandLineHelper.GetCommandLineArgs("horn"))).Return(componentTree).IgnoreArguments();

            wholeTree.Stub(x => x.GetBuildMetaData("horn")).Return(buildMetaData).IgnoreArguments().Repeat.Any();

            wholeTree.Stub(x => x.Result).Return(new DirectoryInfo(@"C:\somewhere\build_root_dir"));
        }
开发者ID:kkozmic,项目名称:horn_src,代码行数:20,代码来源:PackageBuilderSpecification.cs

示例4: Because

        protected override void Because()
        {
            packageTree = CreateStub<IPackageTree>();

            packageTree.Stub(x => x.WorkingDirectory).Return(new DirectoryInfo(@"C:\"));

            buildToolStub = CreateStub<IBuildTool>();

            buildEngine = new BuildEngine(buildToolStub, "deeper/than/this/somebuild.file", FrameworkVersion.FrameworkVersion35, CreateStub<IDependencyDispatcher>());

            buildEngine.Build(new StubProcessFactory(), packageTree);
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:12,代码来源:BuildEngineSpec.cs

示例5: before_each_spec

        public override void before_each_spec()
        {
            var dependencyResolver = MockRepository.GenerateStub<IDependencyResolver>();
            fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>();
            packageBuilder = MockRepository.GenerateStub<IPackageCommand>();
            rootPackageTree = MockRepository.GenerateStub<IPackageTree>();
            buildMetaData = MockRepository.GenerateStub<IBuildMetaData>();

            commandArgs = new CommandArgs("horn", false, null, false, null);

            dependencyResolver.Stub(x => x.HasComponent<ICommandArgs>()).Return(true);

            dependencyResolver.Stub(x => x.Resolve<ICommandArgs>()).Return(commandArgs);

            dependencyResolver.Stub(x => x.Resolve<IPackageCommand>("install")
                ).Return(packageBuilder);

            IoC.InitializeWith(dependencyResolver);

            rootPackageTree.Stub(x => x.Result).Return(new DirectoryInfo(@"z:\horn"));

            buildMetaData.ProjectInfo= new Dictionary<string, object>();

            rootPackageTree.Stub(x => x.GetAllPackageMetaData()).Return(new List<IBuildMetaData> {buildMetaData});

            rootPackageTree.Stub(x => x.Name).Return("horn");

            var category = new Category(null, rootPackageTree);

            fileSystemProvider.Stub(x => x.GetFiles(Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).Return(
                new List<FileInfo>
                    {
                        new FileInfo(string.Format("horn-{0}.zip",
                                                   new DateTime(2009, 10, 30).ToString(FileSystemProvider.FileDateFormat))),
                        new FileInfo(string.Format("horn-{0}.zip",
                                                   new DateTime(2009, 10, 29).ToString(FileSystemProvider.FileDateFormat))),
                        new FileInfo(string.Format("horn-{0}.zip",
                                                   new DateTime(2009, 10, 31).ToString(FileSystemProvider.FileDateFormat)))
                    }.ToArray());

            package = new PackageDouble(category, buildMetaData);

            string zipFileName = string.Format("{0}-{1}.zip", package.Name, DateTime.Now.ToString(FileSystemProvider.FileDateFormat));

            fileSystemProvider.Stub(
                x => x.ZipFolder(Arg<DirectoryInfo>.Is.TypeOf, Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).
                Return(new FileInfo(zipFileName));
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:48,代码来源:BuildAndZipSpec.cs


注:本文中的IPackageTree.Stub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。