本文整理汇总了C#中IFileSystemProvider.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IFileSystemProvider.Stub方法的具体用法?C# IFileSystemProvider.Stub怎么用?C# IFileSystemProvider.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystemProvider
的用法示例。
在下文中一共展示了IFileSystemProvider.Stub方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: before_each_spec
public override void before_each_spec()
{
var dependencyResolver = MockRepository.GenerateStub<IDependencyResolver>();
metaDataSynchroniser = MockRepository.GenerateStub<IMetaDataSynchroniser>();
fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>();
packageBuilder = MockRepository.GenerateStub<IPackageCommand>();
var configReader = new BooBuildConfigReader();
dependencyResolver.Stub(x => x.Resolve<IBuildConfigReader>()).Return(configReader);
dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(
new SourceControlDouble("http://someurl.com/"));
dependencyResolver.Stub(x => x.Resolve<IPackageCommand>("install")).Return(packageBuilder);
fileSystemProvider.Stub(x => x.GetTemporaryBuildDirectory(Arg<DirectoryInfo>.Is.TypeOf)).Return(
new DirectoryInfo(@"C:\temp\build"));
IoC.InitializeWith(dependencyResolver);
fileSystemProvider.Stub(x => x.GetHornRootDirectory(Arg<string>.Is.TypeOf)).Return(FileSystemHelper.GetFakeDummyHornDirectory());
fileSystemProvider.Stub(x => x.CreateTemporaryHornDirectory(Arg<string>.Is.TypeOf)).Return(new DirectoryInfo(HornConfig.Settings.HornTempDirectory));
fileSystemProvider.Stub(x => x.ZipFolder(Arg<DirectoryInfo>.Is.TypeOf, Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).Return(
new FileInfo(@"C:\zip"));
siteStructureBuilder = GetSiteBuilder();
siteStructureBuilder.Initialise();
siteStructureBuilder.Build();
}
示例2: before_each_spec
public override void before_each_spec()
{
base.before_each_spec();
hornDirectory = FileSystemHelper.GetFakeDummyHornDirectory();
metaDataSynchroniser = MockRepository.GenerateStub<IMetaDataSynchroniser>();
fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>();
fileSystemProvider.Stub(x => x.GetHornRootDirectory(Arg<string>.Is.TypeOf)).Return(FileSystemHelper.GetFakeDummyHornDirectory());
dependencyResolver.Stub(x => x.Resolve<IPackageTree>());
siteStructureBuilder = new SiteStructureBuilder(metaDataSynchroniser, fileSystemProvider, new DirectoryInfo(@"C:\").FullName);
siteStructureBuilder.Initialise();
}
示例3: 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));
}