public void GetBuildFullResponse_Id_Build() { // Arrange var teamCityCaller = CreateTeamCityCaller(); A.CallTo(() => teamCityCaller.Get <BuildModel>("/app/rest/builds/id:123")).Returns(new BuildModel { Id = 123, Status = "SUCCESS" }); var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller); // Act var build = connectedTc.GetBuild(123); // Assert build.Id.Should().Be(123); }
public void GetBuild_Id_Build() { // Arrange var teamCityCaller = CreateTeamCityCaller(); A.CallTo( () => teamCityCaller.Get <BuildWrapper>( "/app/rest/builds?locator=id:123,&fields=count,build(buildTypeId,href,id,number,state,status,webUrl)")) .Returns(new BuildWrapper { Count = "1", Build = new List <BuildModel>(new[] { new BuildModel { Id = 987, Status = "SUCCESS" } }) }); var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller); // Act var build = connectedTc.GetBuild(_ => _.Id(123)); // Assert build.Id.Should().Be(987); }
public void GetBuild_Id_Build() { // Arrange var teamCityCaller = CreateTeamCityCaller(); A.CallTo( () => teamCityCaller.Get<BuildWrapper>( "/app/rest/builds?locator=id:123,&fields=count,build(buildTypeId,href,id,number,state,status,webUrl)")) .Returns(new BuildWrapper {Count = "1", Build = new List<Build>(new[] {new Build {Id = 987}})}); var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller); // Act var build = connectedTc.GetBuild(_ => _.Id(123)); // Assert build.Id.Should().Be(987); }
public void GetBuildFullResponse_Id_Build() { // Arrange var teamCityCaller = CreateTeamCityCaller(); A.CallTo(() => teamCityCaller.Get<Build>("/app/rest/builds/id:123")).Returns(new Build { Id = 123 }); var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller); // Act var build = connectedTc.GetBuild(123); // Assert build.Id.Should().Be(123); }