示例#1
0
文件: TestData.cs 项目: bittola/Ether
        private IEnumerable <VSTSRepository> CreateRepositories(int count)
        {
            return(Enumerable.Range(0, count)
                   .Select(i =>
            {
                var projectToTake = _random.Next(1, ProjectIds.Count() + 1);
                var projectId = ProjectIds.Any() ? ProjectIds.Take(projectToTake).Last() : Guid.Empty;

                return new VSTSRepository
                {
                    Id = Guid.NewGuid(),
                    Name = $"Repository {i}",
                    Project = projectId
                };
            }).ToList());
        }
示例#2
0
 public bool IsEmpty()
 {
     if (AllProjects && !AllArtifacts && (ArtifactIds == null || !ArtifactIds.Any()))
     {
         return(true);
     }
     else if (AllArtifacts && !AllProjects && (ProjectIds == null || !ProjectIds.Any()))
     {
         return(true);
     }
     else if (!AllArtifacts && !AllProjects &&
              ((ArtifactIds == null || !ArtifactIds.Any()) ||
               (ProjectIds == null || !ProjectIds.Any())))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }