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


C# IFileSystem.GetPlatformRoot方法代码示例

本文整理汇总了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();
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:26,代码来源:Builder_Databases.cs

示例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();
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:32,代码来源:Builder_BuildProjects.cs

示例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();
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:20,代码来源:Builder_WhenPreparing.cs

示例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();
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:22,代码来源:Builder_Pulling.cs


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