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