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


C# ProjectManager.ListProjects方法代码示例

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


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

示例1: ListProjects_TwoPathsBothWithMultipleProjects_ProjectCountEqualsNumberOfProjectsInBothPaths

        public void ListProjects_TwoPathsBothWithMultipleProjects_ProjectCountEqualsNumberOfProjectsInBothPaths()
        {
            //Arrange
            var random = new Random();
            var numberOfProjectsPath1 = random.Next(2, 10);
            var numberOfProjectsPath2 = random.Next(2, 10);
            var totalNumberOfProjects = numberOfProjectsPath1 + numberOfProjectsPath2;
            var projectsPath1 = Enumerable.Repeat(new Project(), numberOfProjectsPath1);
            var projectsPath2 = Enumerable.Repeat(new Project(), numberOfProjectsPath2);

            var configuration = new Config
            {
                Include = new List<string> {"dummyPath", "dummyPath2"},
                ReferencesConfig = new List<ReferenceConfig>()
            };
            _configProvider.Load<Config>(null).ReturnsForAnyArgs(configuration);
            var fileSystem = Substitute.For<IFileSystem>();

            fileSystem.GetProjects("dummyPath").Returns(new List<Project>(projectsPath1));
            fileSystem.GetProjects("dummyPath2").Returns(new List<Project>(projectsPath2));
            fileSystem.GetDirectories(null).ReturnsForAnyArgs(Enumerable.Empty<string>());

            var manager = new ProjectManager("dummy", _configProvider, _logger, fileSystem);

            //Act
            var prjs = manager.ListProjects();

            //Assert
            Assert.AreEqual(totalNumberOfProjects, prjs.Count);
        }
开发者ID:cebence,项目名称:Reffixer,代码行数:30,代码来源:ProjectManagerTests.cs

示例2: ListProjects_TwoPatshBothWithOneProject_ProjectCountTwo

        public void ListProjects_TwoPatshBothWithOneProject_ProjectCountTwo()
        {
            //Arrange
            var configuration = new Config
            {
                Include = new List<string> {"dummyPath", "dummyPath2"},
                ReferencesConfig = new List<ReferenceConfig>()
            };
            _configProvider.Load<Config>(null).ReturnsForAnyArgs(configuration);
            var fileSystem = Substitute.For<IFileSystem>();

            fileSystem.GetProjects(null).ReturnsForAnyArgs(
                new List<Project>
                {
                    new Project()
                });

            fileSystem.GetDirectories(null).ReturnsForAnyArgs(Enumerable.Empty<string>());

            var manager = new ProjectManager("dummy", _configProvider, _logger, fileSystem);

            //Act
            var prjs = manager.ListProjects();

            //Assert
            Assert.AreEqual(2, prjs.Count);
        }
开发者ID:cebence,项目名称:Reffixer,代码行数:27,代码来源:ProjectManagerTests.cs

示例3: ListProjects_NoPaths_ProjectCountZero

        public void ListProjects_NoPaths_ProjectCountZero()
        {
            //Arrange
            var configuration = new Config
            {
                Include = new List<string>(),
                ReferencesConfig = new List<ReferenceConfig>()
            };

            _configProvider.Load<Config>(null).ReturnsForAnyArgs(configuration);
            var fileSystem = Substitute.For<IFileSystem>();
            var manager = new ProjectManager("dummy", _configProvider, _logger, fileSystem);

            //Act
            var projectCount = manager.ListProjects();

            //Assert
            Assert.AreEqual(0, projectCount.Count);
        }
开发者ID:cebence,项目名称:Reffixer,代码行数:19,代码来源:ProjectManagerTests.cs


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