Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Three tiny additions #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/TeamCitySharp/ActionTypes/Builds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ public Build LastBuildByAgent(string agentName)
)).SingleOrDefault();
}

public void Add2QueueBuildByBuildConfigId(string buildConfigId)
public Build ById(string buildId)
{
var build = _caller.GetFormat<Build>("/app/rest/builds/id:{0}", buildId);

return build;
}

public void Add2QueueBuildByBuildConfigId(string buildConfigId)
{
_caller.GetFormat("/action.html?add2Queue={0}", buildConfigId);
}
Expand Down
1 change: 1 addition & 0 deletions src/TeamCitySharp/ActionTypes/IBuilds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public interface IBuilds
List<Build> NonSuccessfulBuildsForUser(string userName);
List<Build> ByBranch(string branchName);
Build LastBuildByAgent(string agentName);
Build ById(string buildId);
void Add2QueueBuildByBuildConfigId(string buildConfigId);
}
}
9 changes: 9 additions & 0 deletions src/TeamCitySharp/DomainEntities/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ public override string ToString()
{
return Name;
}

public override bool Equals(object obj)
{
return Name.Equals(((Agent)obj).Name);
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
}
}
14 changes: 13 additions & 1 deletion src/TeamCitySharp/TeamCityClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using TeamCitySharp.ActionTypes;
using System;
using System.IO;
using TeamCitySharp.ActionTypes;
using TeamCitySharp.Connection;
using TeamCitySharp.DomainEntities;

namespace TeamCitySharp
{
Expand Down Expand Up @@ -80,5 +83,14 @@ public IBuildArtifacts Artifacts
{
get { return _artifacts ?? (_artifacts = new BuildArtifacts(_caller)); }
}

/// <summary/>
/// <param name="downloadHandler"></param>
/// <param name="build"> </param>
public void DownloadTestsCsv(Action<string> downloadHandler, Build build)
{
string uriPart = string.Format("/get/tests/buildId/{0}", build.Id);
_caller.GetDownloadFormat(downloadHandler, uriPart);
}
}
}