File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,35 @@ public void Should_not_contain_unnecessary_443_port_in_base_url()
175175 A < MemoryStream > . _ ) ) . MustHaveHappened ( ) ;
176176 }
177177
178+ [ Test ]
179+ public void Should_not_preserve_custom_port_in_base_url ( )
180+ {
181+ // given
182+ var serializer = A . Fake < IRdfSerializer > ( ) ;
183+ A . CallTo ( ( ) => serializer . CanSerialize ( A < MediaRange > . Ignored ) ) . Returns ( true ) ;
184+ var processor = new RdfResponseProcessorTestable ( new [ ] { serializer } ) ;
185+
186+ var path = new Url ( "http://example.com:2345/api/test" )
187+ {
188+ BasePath = "api"
189+ } ;
190+
191+ var nancyContext = new NancyContext
192+ {
193+ Request = new Request ( "GET" , path )
194+ } ;
195+
196+ // when
197+ var response = processor . Process ( new MediaRange ( "application/rdf+xml" ) , new object ( ) , nancyContext ) ;
198+ response . Contents ( new MemoryStream ( ) ) ;
199+
200+ // then
201+ A . CallTo ( ( ) => serializer . Serialize (
202+ A < MediaRange > . That . Matches ( mr => mr == RdfSerialization . RdfXml . MediaType ) ,
203+ A < WrappedModel > . That . Matches ( wm => wm . BaseUrl . ToString ( ) == "http://example.com:2345/" ) ,
204+ A < MemoryStream > . _ ) ) . MustHaveHappened ( ) ;
205+ }
206+
178207 [ Test ]
179208 public void Should_pass_actual_requested ( )
180209 {
You can’t perform that action at this time.
0 commit comments