QualiSystems / FluentTc

:ocean: :two_men_holding_hands: :office: Integrate with TeamCity fluently
https://www.nuget.org/packages/fluenttc
Apache License 2.0
44 stars 36 forks source link

Add GetProject() method to RemoteTc that accepts lambda Id() and Name() #102

Open borismod opened 7 years ago

borismod commented 7 years ago

Feature Request

As a user of FluentTc I would like to be able retrieve a project by Id or Name using fluent API, i.e. using lambda

From TeamCity REST API documentation: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-ProjectsandBuildConfiguration/TemplatesLists

Project details: GET http://teamcity:8111/app/rest/projects/projectLocator, where projectLocator can be id:internal_project_id or name:project%20name

Test to reproduce


[Test]
public void GetProject_ById()
{
  var project = new RemoteTc(c=>c.ToHost("HOST").AsGuest())
     .GetProject(project => project.Id("FluentTc") );
}

[Test]
public void GetProject_ByName()
{
  var project = new RemoteTc(c=>c.ToHost("HOST").AsGuest())
     .GetProject(project => project.Name("FluentTc") );
}
WiseLordship commented 7 years ago

I could implement this is you are still looking for help.

borismod commented 7 years ago

@WiseLordship thanks for your help. I'll review it later on and will update you