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
2626 ReturnType < PartialViewResult > ( t => t . ShouldRenderDefaultPartialView ( ) ) ,
2727 ReturnType < FileContentResult > ( t => t . ShouldRenderFile ( ) ) ,
2828 ReturnType < FileStreamResult > ( t => t . ShouldRenderFileStream ( ) ) ,
29+ ReturnType < FilePathResult > ( t=> t . ShouldRenderFilePath ( ) ) ,
2930 ReturnType < HttpStatusCodeResult > ( t => t . ShouldGiveHttpStatus ( ) ) ,
3031 ReturnType < JsonResult > ( t => t . ShouldReturnJson ( ) ) ,
3132 } ;
@@ -324,6 +325,12 @@ public void Check_for_file_stream_result_and_check_content_type()
324325 _controller . WithCallTo ( c => c . EmptyStream ( ) ) . ShouldRenderFileStream ( ControllerResultTestController . FileContentType ) ;
325326 }
326327
328+ [ Test ]
329+ public void Check_for_file_path_result ( )
330+ {
331+ _controller . WithCallTo ( c => c . EmptyFilePath ( ) ) . ShouldRenderFilePath ( ) ;
332+ }
333+
327334 #endregion
328335
329336 #region HTTP Status tests
Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ public ActionResult EmptyStream()
142142 return File ( content , FileContentType ) ;
143143 }
144144
145+ public ActionResult EmptyFilePath ( )
146+ {
147+ return File ( "dummy" , FileContentType ) ;
148+ }
149+
145150 public ActionResult NamedView ( )
146151 {
147152 return View ( ViewName ) ;
Original file line number Diff line number Diff line change @@ -238,6 +238,12 @@ public FileStreamResult ShouldRenderFileStream(string contentType = null)
238238 return fileResult ;
239239 }
240240
241+ public FilePathResult ShouldRenderFilePath ( )
242+ {
243+ ValidateActionReturnType < FilePathResult > ( ) ;
244+ return ( FilePathResult ) _actionResult ;
245+ }
246+
241247 #endregion
242248
243249 #region Http Status
You can’t perform that action at this time.
0 commit comments