public void PinBuildCalled_WithComment_BuildPinnedWithComment()
        {
            // Arrange
            var teamCityClientMock = A.Fake <ITeamCityApiClient>();

            var pinningService = new BuildPinningService(teamCityClientMock);

            // Act
            pinningService.Pin(123, "some comment");

            // Assert
            A.CallTo(() => teamCityClientMock.Put <string>("builds/123/pin/", "some comment")).MustHaveHappened();
        }
        public void PinBuildCalled_InvalidBuildId_ExceptionThrown()
        {
            // Arrange
            var teamCityClientMock = A.Fake <ITeamCityApiClient>();

            A.CallTo(() => teamCityClientMock.Put <string>("builds/123/pin/", null))
            .Throws(new HttpException(HttpStatusCode.NotFound));

            var pinningService = new BuildPinningService(teamCityClientMock);

            // Act
            Action action = () => pinningService.Pin(123);

            // Assert
            action.ShouldThrow <HttpException>().Which.StatusCode.Should().Be(HttpStatusCode.NotFound);
        }