Skip to content

Commit 1d55cb0

Browse files
committed
Removed ShouldRenderFileStream.
1 parent 49b5b84 commit 1d55cb0

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

TestStack.FluentMVCTesting.Tests/ControllerResultTestTests.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ class ControllerResultTestShould
2929
ReturnType<PartialViewResult>(t => t.ShouldRenderDefaultPartialView()),
3030
ReturnType<FileContentResult>(t => t.ShouldRenderFile()),
3131
ReturnType<FileContentResult>(t => t.ShouldRenderFile("")),
32-
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream()),
3332
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents()),
3433
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents(new byte[0])),
3534
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents(new byte[0], "")),
3635
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents("")),
3736
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents("", "")),
3837
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents("", "", Encoding.UTF8)),
39-
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream("")),
4038
ReturnType<FilePathResult>(t => t.ShouldRenderFilePath()),
4139
ReturnType<FilePathResult>(t => t.ShouldRenderFilePath("")),
4240
ReturnType<FilePathResult>(t => t.ShouldRenderFilePath("", "")),
@@ -483,29 +481,6 @@ public void Check_for_file_result_and_check_content_type()
483481
_controller.WithCallTo(c => c.EmptyFile()).ShouldRenderFile(ControllerResultTestController.FileContentType);
484482
}
485483

486-
[Test]
487-
public void Check_for_file_stream_result()
488-
{
489-
_controller.WithCallTo(c => c.EmptyStream()).ShouldRenderFileStream();
490-
}
491-
492-
[Test]
493-
public void Check_for_file_stream_result_and_check_content_type()
494-
{
495-
_controller.WithCallTo(c => c.EmptyStream()).ShouldRenderFileStream(ControllerResultTestController.FileContentType);
496-
}
497-
498-
[Test]
499-
public void Check_for_file_stream_result_and_check_invalid_content_type()
500-
{
501-
const string contentType = "application/dummy";
502-
503-
var exception = Assert.Throws<ActionResultAssertionException>(() =>
504-
_controller.WithCallTo(c => c.EmptyFile()).ShouldRenderAnyFile(contentType));
505-
506-
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.", contentType, ControllerResultTestController.FileContentType)));
507-
}
508-
509484
[Test]
510485
public void Check_for_file_path_result()
511486
{

TestStack.FluentMvcTesting/ControllerResultTest.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,6 @@ public FileContentResult ShouldRenderFile(string contentType = null)
292292
return fileResult;
293293
}
294294

295-
public FileStreamResult ShouldRenderFileStream(string contentType = null)
296-
{
297-
ValidateActionReturnType<FileStreamResult>();
298-
299-
var fileResult = (FileStreamResult)_actionResult;
300-
301-
if (contentType != null && fileResult.ContentType != contentType)
302-
{
303-
throw new ActionResultAssertionException(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.", contentType, fileResult.ContentType));
304-
}
305-
306-
return fileResult;
307-
}
308-
309295
public FilePathResult ShouldRenderFilePath(string fileName = null, string contentType = null)
310296
{
311297
ValidateActionReturnType<FilePathResult>();

0 commit comments

Comments
 (0)