public async Task WithVolumeIdParameterItReturnsCorrectHttpStatusCode(string volumeId, string statusCode)
        {
            //Arrange
            HttpStatusCode expectedHttpStatusCode = (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), statusCode);

            //Act
            var response = await _googleBooksApiProxy.GetVolume(volumeId);

            //Assert
            response.StatusCode.Should().Be(expectedHttpStatusCode);
        }
Exemple #2
0
        public async Task ItReturnsOkAndResponseWithVolumeData(string volumeId)
        {
            //Arrange & Act
            var response = await _googleBooksApiProxy.GetVolume(volumeId);

            //Assert
            using (new AssertionScope())
            {
                response.StatusCode.Should().Be(HttpStatusCode.OK);
                response.IsSuccessful.Should().BeTrue();
                response.Data.Id.Should().Be(volumeId);
                response.Data.Kind.Should().Be("books#volume");
                response.Data.Etag.Should().NotBeNullOrWhiteSpace();
            }
        }