Example #1
0
        public void Get_ErrorOccursRetrievingReleasePaths_InternalServerErrorReturned()
        {
            //Arrange
            _releaseRepositoryMock.Setup((stub) => stub.GetReleasePaths())
            .Throws <Exception>();

            //Act
            var result = _sut.Get();

            //Assert
            AssertionHelper.AssertHttpResponseMessageStatus(result, HttpStatusCode.InternalServerError);
        }
Example #2
0
        public void Get_InvalidIncludedReleasePathIdsHeaderSpecified_BadRequestStatusReturned()
        {
            //Arrange
            var invalidRequest = new GetReleasesHttpRequestMessageBuilder()
                                 .WithIncludedReleasePathIdsHeader("invalid")
                                 .Build();

            //Act
            var result = _sut.Get(invalidRequest);

            //Assert
            AssertionHelper.AssertHttpResponseMessageStatus(result, HttpStatusCode.BadRequest);
        }
Example #3
0
        public void Get_ErrorOccursRetrievingReleaseData_InternalServerErrorReturned()
        {
            //Arrange
            var request = new GetReleasesHttpRequestMessageBuilder().Build();

            _releaseRepositoryMock.Setup((stub) => stub.GetReleaseData(It.IsAny <string>(), It.IsAny <int>()))
            .Throws <Exception>();

            //Act
            var result = _sut.Get(request);

            //Assert
            AssertionHelper.AssertHttpResponseMessageStatus(result, HttpStatusCode.InternalServerError);
        }