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); }
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); }
public void GetId_throws( [Values(null, "", " ")] string name ) { Assert.That(() => _fakeTool.GetId(name), Throws.TypeOf <ArgumentException>()); }