private HousingSearchAPIResponse GenerateApiResponse(int numberOfResults)
        {
            var results = new HousingSearchAPIResponseResults
            {
                Assets = _fixture.CreateMany <Asset>(numberOfResults).ToList(),
            };

            return(new HousingSearchAPIResponse
            {
                Total = numberOfResults,
                Results = results
            });
        }
        public void HousingSearchAPIResponseToResponseWhenEmptyReturnsEmptyList()
        {
            // Arrange
            var results = new HousingSearchAPIResponseResults
            {
                Assets = new List <Asset>()
            };

            var model = new HousingSearchAPIResponse
            {
                Total   = 0,
                Results = results
            };

            // Act
            var response = model.ToResponse();

            // Assert
            response.Properties.Should().HaveCount(0);
            response.Total.Should().Be(0);
        }
        public void HousingSearchAPIResponseToResponseWhenCalledReturnsResponseObject()
        {
            // Arrange
            var numberOfResults = _random.Next(2, 5);

            var results = new HousingSearchAPIResponseResults
            {
                Assets = _fixture.CreateMany <Asset>(numberOfResults).ToList()
            };

            var model = new HousingSearchAPIResponse
            {
                Total   = numberOfResults,
                Results = results
            };

            // Act
            var response = model.ToResponse();

            // Assert
            response.Properties.Should().HaveCount(numberOfResults);
            response.Total.Should().Be(numberOfResults);
        }