You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following overload of the `ShouldRenderFileStream` method has been *replaced*:
6
+
7
+
public FileStreamResult ShouldRenderFileStream(string contentType = null)
8
+
9
+
We place emphasis on the word "replace" because it is important to note that this overload has not been removed but replaced - you will not encounter a compile-time error if you upgrade, but you will encounter a logical error when you run your existing test.
10
+
11
+
### Reason
12
+
13
+
The aforementioned overload has been replaced in order to enable an overload that takes a stream for comparison in a way that is consistent with the existing convention.
14
+
15
+
### Fix
16
+
17
+
Use a [named argument](http://msdn.microsoft.com/en-gb/library/dd264739.aspx).
The `ShouldRenderFile` method was ambiguous because it had the possibility to be interperted to test for a `FileResult` when in fact, it tested for a `FileContentResult`.
35
+
36
+
It is for this reason that we introduced two unequivocal methods namely, `ShouldRenderAnyFile` and `ShouldRenderFileContents`.
37
+
38
+
### Fix
39
+
40
+
Use the `ShouldRenderFileContents` method instead:
thrownewActionResultAssertionException(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.",contentType,fileResult.ContentType));
thrownewActionResultAssertionException(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.",contentType,fileResult.ContentType));
thrownewActionResultAssertionException(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.",contentType,fileResult.ContentType));
thrownewActionResultAssertionException(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.",contentType,fileResult.ContentType));
thrownewActionResultAssertionException(string.Format("Expected file to be of content type '{0}', but instead was given '{1}'.",contentType,fileResult.ContentType));
0 commit comments