File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
TestStack.FluentMVCTesting.Tests
TestStack.FluentMvcTesting Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class ControllerResultTestShould
26
26
ReturnType < PartialViewResult > ( t => t . ShouldRenderDefaultPartialView ( ) ) ,
27
27
ReturnType < FileContentResult > ( t => t . ShouldRenderFile ( ) ) ,
28
28
ReturnType < FileStreamResult > ( t => t . ShouldRenderFileStream ( ) ) ,
29
+ ReturnType < FilePathResult > ( t=> t . ShouldRenderFilePath ( ) ) ,
29
30
ReturnType < HttpStatusCodeResult > ( t => t . ShouldGiveHttpStatus ( ) ) ,
30
31
ReturnType < JsonResult > ( t => t . ShouldReturnJson ( ) ) ,
31
32
} ;
@@ -324,6 +325,12 @@ public void Check_for_file_stream_result_and_check_content_type()
324
325
_controller . WithCallTo ( c => c . EmptyStream ( ) ) . ShouldRenderFileStream ( ControllerResultTestController . FileContentType ) ;
325
326
}
326
327
328
+ [ Test ]
329
+ public void Check_for_file_path_result ( )
330
+ {
331
+ _controller . WithCallTo ( c => c . EmptyFilePath ( ) ) . ShouldRenderFilePath ( ) ;
332
+ }
333
+
327
334
#endregion
328
335
329
336
#region HTTP Status tests
Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ public ActionResult EmptyStream()
142
142
return File ( content , FileContentType ) ;
143
143
}
144
144
145
+ public ActionResult EmptyFilePath ( )
146
+ {
147
+ return File ( "dummy" , FileContentType ) ;
148
+ }
149
+
145
150
public ActionResult NamedView ( )
146
151
{
147
152
return View ( ViewName ) ;
Original file line number Diff line number Diff line change @@ -238,6 +238,12 @@ public FileStreamResult ShouldRenderFileStream(string contentType = null)
238
238
return fileResult ;
239
239
}
240
240
241
+ public FilePathResult ShouldRenderFilePath ( )
242
+ {
243
+ ValidateActionReturnType < FilePathResult > ( ) ;
244
+ return ( FilePathResult ) _actionResult ;
245
+ }
246
+
241
247
#endregion
242
248
243
249
#region Http Status
You can’t perform that action at this time.
0 commit comments