本文整理汇总了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);
}
示例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);
}
示例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"));
}
示例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);
}
示例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));
}