public static JobProfile Map(this JobProfileApiResponse resp)
        {
            if (resp != null)
            {
                return(new JobProfile
                {
                    DocumentId = resp.Uri != null?Guid.Parse(resp.Uri.Segments.Last().TrimEnd('/')) : Guid.NewGuid(),
                                     Description = resp.Description,
                                     Title = resp.Title,
                                     Uri = resp.Uri,
                                     Links = resp.Links,
                });
            }

            throw new InvalidOperationException($"{nameof(resp)} is null");
        }
        public void MapJobProfileApiResponseToJobProfileReturnsJobProfile()
        {
            // arrange
            var apiJobProfile = new JobProfileApiResponse {
                Description = "A Description", Title = "Comedian", Uri = new Uri($"http://someuri/jobprofile/identifier/{Guid.NewGuid()}"), Links = new List <Link> {
                    new Link {
                        LinkValue = new KeyValuePair <string, Models.DynamicLink>("daytodaytask", new Models.DynamicLink {
                            Href = new Uri("http://someuri/daytotasktask/identifier")
                        })
                    }
                }
            };

            // act
            var jobProfile = apiJobProfile.Map();

            // assert
            Assert.NotNull(jobProfile);
            Assert.Equal(apiJobProfile.Title, jobProfile.Title);
            Assert.Equal(apiJobProfile.Description, jobProfile.Description);
            Assert.Equal(apiJobProfile.Uri, jobProfile.Uri);
            Assert.Equal(apiJobProfile.Links, jobProfile.Links);
        }