File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,5 +111,18 @@ public void create_uri_absolute()
111111 // assert
112112 Assert . Equal ( "http://myserver.com/api/beers/BeerName" , link . ToString ( ) ) ;
113113 }
114+
115+ [ Fact ]
116+ public void create_link_uses_templates_title ( )
117+ {
118+ // arrange
119+ var templateLink = new Link ( "beerbyname" , "http://myserver.com/api/beers{name}" , "Beer" ) ;
120+
121+ // act
122+ var link = templateLink . CreateLink ( new { name = "BeerName" } ) ;
123+
124+ // assert
125+ Assert . Equal ( link . Title , "Beer" ) ;
126+ }
114127 }
115128}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public bool IsTemplated
3434 /// <returns>A non templated link</returns>
3535 public Link CreateLink ( string newRel , params object [ ] parameters )
3636 {
37- return new Link ( newRel , CreateUri ( parameters ) . ToString ( ) ) ;
37+ return new Link ( newRel , CreateUri ( parameters ) . ToString ( ) , Title ) ;
3838 }
3939
4040 /// <summary>
You can’t perform that action at this time.
0 commit comments