本文整理汇总了C#中IFileSystem.GetPlatformRoot方法的典型用法代码示例。如果您正苦于以下问题:C# IFileSystem.GetPlatformRoot方法的具体用法?C# IFileSystem.GetPlatformRoot怎么用?C# IFileSystem.GetPlatformRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem.GetPlatformRoot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: builder
public void builder()
{
_filesystem = Substitute.For<IFileSystem>();
_filesystem.GetPlatformRoot().Returns(The.Root);
var dbpath = The.Root.Navigate((FilePath)"group1/proj2/DatabaseScripts");
_filesystem.Exists(null).ReturnsForAnyArgs(c=> c.Args()[0] as FilePath == dbpath);
_filesystem.SortedDescendants(null,null).ReturnsForAnyArgs(new [] {(FilePath)"one",(FilePath)"two"});
_modules = Substitute.For<IModules>();
_modules.Paths.Returns(new[] {"group1/proj1", "group1/proj2", "group2/proj3"});
_modules.Repos.Returns(new[] {"p1Repo", "p2Repo", "p3Repo"});
_locks = new List<AutoResetEvent> { new AutoResetEvent(true), new AutoResetEvent(true), new AutoResetEvent(true) };
_modules.CreateAndSetLocks().Returns(_locks);
_git = Substitute.For<IGit>();
_depMgr = Substitute.For<IDependencyManager>();
_ruleFac = Substitute.For<IRuleFactory>();
_ruleFac.GetModules().Returns(_modules);
_buildCmd = Substitute.For<IBuildCmd>();
_subject = new Builder(_filesystem, _git, _depMgr, _ruleFac, _buildCmd);
_subject.Prepare();
_subject.RebuildDatabases();
}
示例2: builder
public void builder()
{
_filesystem = Substitute.For<IFileSystem>();
_filesystem.GetPlatformRoot().Returns(The.Root);
_filesystem.Exists(null).ReturnsForAnyArgs(true);
_modules = Substitute.For<IModules>();
_modules.Paths.Returns(new[] { "group1/proj1", "group1/proj2", "group2/proj3" });
_modules.Repos.Returns(new[] { "p1Repo", "p2Repo", "p3Repo" });
_locks = new List<AutoResetEvent> { new AutoResetEvent(true), new AutoResetEvent(true), new AutoResetEvent(true) };
_modules.CreateAndSetLocks().Returns(_locks);
_patterns = new Patterns
{
DependencyPattern = "*.dll",
DependencyPath = (FilePath)"lib",
Masters = new FilePath[] { }
};
_git = Substitute.For<IGit>();
_depMgr = Substitute.For<IDependencyManager>();
_ruleFac = Substitute.For<IRuleFactory>();
_ruleFac.GetModules().Returns(_modules);
_ruleFac.GetRulePatterns().Returns(_patterns);
_buildCmd = Substitute.For<IBuildCmd>();
_subject = new Builder(_filesystem, _git, _depMgr, _ruleFac, _buildCmd);
_subject.Prepare();
_subject.GetDependenciesAndBuild();
}
示例3: builder
public void builder()
{
_filesystem = Substitute.For<IFileSystem>();
_filesystem.GetPlatformRoot().Returns(The.Root);
_missingRepo = The.Root.Append((FilePath)"/group1/proj2");
_filesystem.Exists(null).ReturnsForAnyArgs(c=> (c.Args()[0] as FilePath !=_missingRepo));
_modules = Substitute.For<IModules>();
_modules.Paths.Returns(new[] {"group1/proj1", "group1/proj2", "group2/proj3"});
_modules.Repos.Returns(new[] {"p1Repo", "p2Repo", "p3Repo"});
_git = Substitute.For<IGit>();
_depMgr = Substitute.For<IDependencyManager>();
_ruleFac = Substitute.For<IRuleFactory>();
_ruleFac.GetModules().Returns(_modules);
_subject = new Builder(_filesystem, _git, _depMgr, _ruleFac, null);
_subject.Prepare();
}
示例4: builder
public void builder()
{
_filesystem = Substitute.For<IFileSystem>();
_filesystem.GetPlatformRoot().Returns(The.Root);
_filesystem.Exists(null).ReturnsForAnyArgs(c=> (c.Args()[0] as FilePath != (FilePath)"group1/proj2"));
_modules = Substitute.For<IModules>();
_modules.Paths.Returns(new[] {"group1/proj1", "group1/proj2", "group2/proj3"});
_modules.Repos.Returns(new[] {"p1Repo", "p2Repo", "p3Repo"});
_locks = new List<AutoResetEvent> { new AutoResetEvent(false), new AutoResetEvent(false), new AutoResetEvent(false) };
_modules.CreateAndSetLocks().Returns(_locks);
_git = Substitute.For<IGit>();
_depMgr = Substitute.For<IDependencyManager>();
_ruleFac = Substitute.For<IRuleFactory>();
_ruleFac.GetModules().Returns(_modules);
_subject = new Builder(_filesystem, _git, _depMgr, _ruleFac, null);
_subject.Prepare();
_subject.PullRepos();
}