Skip to content

Commit 3fd233d

Browse files
committed
Fix FileContentResultAssertions messages.
1 parent 3921ba1 commit 3fd233d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/FluentAssertions.AspNetCore.Mvc/FailureMessages.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/FluentAssertions.AspNetCore.Mvc/FailureMessages.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@
130130
<value>Expected {0} to be of type '{1}' but was '{2}'</value>
131131
</data>
132132
<data name="FileContentResult_WithFileContents_LengthFail" xml:space="preserve">
133-
<value>Expected "FileContentResult.FileContents" to have {0} byte(s), but found {1}.</value>
133+
<value>Expected FileContentResult.FileContents to have {0} byte(s){reason} but found {1}.</value>
134134
</data>
135135
<data name="FileContentResult_WithFileContents_MatchFail" xml:space="preserve">
136-
<value>Expected "FileContentResult.FileContents[{0}]" to be {1:x2}, but found {2:x2}.</value>
136+
<value>Expected FileContentResult.FileContents[{0}] to be {1:x2}{reason} but found {2:x2}.</value>
137137
</data>
138138
<data name="RedirectToActionResult_RouteValues_ContainsKey" xml:space="preserve">
139139
<value>RedirectToActionResult.RouteValues does not contain key {0}.</value>

tests/FluentAssertions.AspNetCore.Mvc.Tests/FileContentResultAssertions_Tests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public void WithFileContents_GivenExpectedValue_ShouldPass()
2222
[Theory]
2323
[InlineData(
2424
"Test 1", "Test 11"
25-
, "Expected \"FileContentResult.FileContents\" to have 7 byte(s), but found 6.")]
25+
, "Expected FileContentResult.FileContents to have 7 byte(s) because it is 10 but found 6.")]
2626
[InlineData(
2727
"Test 1a", "Test 2a"
28-
, "Expected \"FileContentResult.FileContents[5]\" to be 0x32, but found 0x31.")]
28+
, "Expected FileContentResult.FileContents[5] to be 0x32 because it is 10 but found 0x31.")]
2929
public void WithFileContents_GivenUnexpectedValue_ShouldFail(
3030
string actual, string expected, string failureMessage)
3131
{
@@ -35,7 +35,7 @@ public void WithFileContents_GivenUnexpectedValue_ShouldFail(
3535

3636
Action a = () => result.Should()
3737
.BeFileContentResult()
38-
.WithFileContents(expectedBytes);
38+
.WithFileContents(expectedBytes, "it is {0}", 10);
3939

4040
a.Should().Throw<Exception>()
4141
.WithMessage(failureMessage);

0 commit comments

Comments
 (0)