コード例 #1
0
ファイル: Program.cs プロジェクト: robbratton/AzureDevOpsCLI
        private static Commands SetUpCommands()
        {
            var pat = ToolHelper.GetPersonalAccessToken();

            var client = new Client(pat);

            var projectTool = new ProjectTool(
                client,
                AppSettings.AzureDevOpsOrganization,
                AppSettings.AzureDevOpsProject
                );

            var projectId = (Guid)projectTool.GetId(AppSettings.AzureDevOpsProject).Result;

            var buildTool = new BuildDefinitionTool(
                client,
                AppSettings.AzureDevOpsOrganization,
                AppSettings.AzureDevOpsProject,
                projectId
                );

            var releaseTool = new ReleaseDefinitionTool(
                client,
                AppSettings.AzureDevOpsOrganization,
                AppSettings.AzureDevOpsProject
                );

            var repositoryTool = new RepositoryTool(
                client,
                AppSettings.AzureDevOpsOrganization,
                AppSettings.AzureDevOpsProject,
                projectId
                );

            var taskTool = new TaskGroupTool(
                client,
                AppSettings.AzureDevOpsOrganization,
                AppSettings.AzureDevOpsProject
                );

            var variableGroupTool = new VariableGroupTool(
                client,
                AppSettings.AzureDevOpsOrganization,
                AppSettings.AzureDevOpsProject
                );

            var commands = new Commands(
                buildTool,
                releaseTool,
                projectTool,
                repositoryTool,
                taskTool,
                variableGroupTool);

            return(commands);
        }
コード例 #2
0
        private static RepositoryTool SetUpRealTool()
        {
            var pat    = ToolHelper.GetPersonalAccessToken();
            var client = new Client(pat);

            var projectTool = new ProjectTool(
                client,
                TestHelper.RealOrganization,
                TestHelper.RealProject);

            var projectId = Guid.Parse(projectTool.GetId(TestHelper.RealProject).Result.ToString());

            var output = new RepositoryTool(
                client,
                TestHelper.RealOrganization,
                TestHelper.RealProject,
                projectId);

            return(output);
        }
コード例 #3
0
 public void GetId_throws(
     [Values(null, "", " ")] string name
     )
 {
     Assert.That(() => _fakeTool.GetId(name), Throws.TypeOf <ArgumentException>());
 }