public void GetBuildConfiguration_Id() { // Arrange var teamCityCaller = CreateTeamCityCaller(); A.CallTo(() => teamCityCaller.Get <BuildTypeWrapper>("/app/rest/buildTypes?locator=id:bt123")) .Returns(new BuildTypeWrapper { BuildType = new List <BuildConfiguration>(new[] { new BuildConfiguration { Id = "bt123" } }) }); A.CallTo(() => teamCityCaller.Get <BuildConfiguration>("/app/rest/buildTypes/id:bt123")) .Returns(new BuildConfiguration { Id = "bt123", SnapshotDependencies = new SnapshotDependencies { SnapshotDependency = new List <SnapshotDependency>(new[] { new SnapshotDependency() { Id = "dep.bt123" } }) } }); var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller); // Act var buildConfiguration = connectedTc.GetBuildConfiguration(_ => _.Id("bt123")); // Assert buildConfiguration.SnapshotDependencies.SnapshotDependency.Single().Id.Should().Be("dep.bt123"); }
public void GetBuildConfiguration_Id() { // Arrange var teamCityCaller = CreateTeamCityCaller(); A.CallTo(() => teamCityCaller.Get<BuildTypeWrapper>("/app/rest/buildTypes?locator=id:bt123")) .Returns(new BuildTypeWrapper { BuildType = new List<BuildConfiguration>(new[] { new BuildConfiguration { Id = "bt123" } }) }); A.CallTo(() => teamCityCaller.Get<BuildConfiguration>("/app/rest/buildTypes/id:bt123")) .Returns(new BuildConfiguration { Id = "bt123", SnapshotDependencies = new SnapshotDependencies { SnapshotDependency = new List<SnapshotDependency>(new[] { new SnapshotDependency() { Id = "dep.bt123" } }) } }); var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller); // Act var buildConfiguration = connectedTc.GetBuildConfiguration(_ => _.Id("bt123")); // Assert buildConfiguration.SnapshotDependencies.SnapshotDependency.Single().Id.Should().Be("dep.bt123"); }