public void AddLinksToInquiryResponse_adds_AllTasks_link()
 {
     var link = new Link();
     var inquiryResponse = new PagedTaskDataInquiryResponse();
     _taskLinkServiceMock.Setup(x => x.GetAllTasksLink()).Returns(link);
     _inquiryProcessor.AddLinksToInquiryResponse(inquiryResponse);
     Assert.AreSame(link, inquiryResponse.Links.Single());
 }
Beispiel #2
0
 public void AddLink(Link link)
 {
     Links.Add(link);
 }
 public virtual Link GetLink(string pathFragment, string relValue, HttpMethod httpMethod)
 {
     const string delimitedVersionedApiRouteBaseFormatString =
         Constants.CommonRoutingDefinitions.ApiSegmentName + "/{0}/";
     var path =
         string.Concat(
             string.Format(
                 delimitedVersionedApiRouteBaseFormatString,
                 _userSession.ApiVersionInUse), pathFragment);
     var uriBuilder = new UriBuilder
     {
         Scheme = _userSession.RequestUri.Scheme,
         Host = _userSession.RequestUri.Host,
         Port = _userSession.RequestUri.Port,
         Path = path
     };
     var link = new Link
     {
         Href = uriBuilder.Uri.AbsoluteUri,
         Rel = relValue,
         Method = httpMethod.Method
     };
     return link;
 }