Skip to content

Commit 2dd41eb

Browse files
committed
Tweaked file contents error message formatting.
1 parent 8c2c2c7 commit 2dd41eb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

TestStack.FluentMVCTesting.Tests/ControllerResultTestTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ public void Check_for_file_content_result_and_check_invalid_binary_content()
359359
var exception = Assert.Throws<ActionResultAssertionException>(() =>
360360
_controller.WithCallTo(c => c.File()).ShouldRenderFileContents(contents));
361361

362-
Assert.True(exception.Message.StartsWith("Expected file contents to be "));
363-
Assert.True(exception.Message.EndsWith("."));
364-
Assert.True(string.Join(",", contents).All(exception.Message.Contains));
365-
Assert.True(string.Join(",", ControllerResultTestController.FileContents).All(exception.Message.Contains));
362+
Assert.True(exception.Message.StartsWith("Expected file contents to be equal to ["));
363+
Assert.True(exception.Message.EndsWith("]."));
364+
Assert.True(string.Join(", ", contents).All(exception.Message.Contains));
365+
Assert.True(string.Join(", ", ControllerResultTestController.FileContents).All(exception.Message.Contains));
366366
}
367367

368368
[Test]

TestStack.FluentMvcTesting/ControllerResultTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ public FileContentResult ShouldRenderFileContents(byte[] contents = null, string
240240
if (contents != null && !fileResult.FileContents.SequenceEqual(contents))
241241
{
242242
throw new ActionResultAssertionException(string.Format(
243-
"Expected file contents to be equal to {0}, but instead was given {1}.",
244-
string.Join(",", contents),
245-
string.Join(",", fileResult.FileContents)));
243+
"Expected file contents to be equal to [{0}], but instead was given [{1}].",
244+
string.Join(", ", contents),
245+
string.Join(", ", fileResult.FileContents)));
246246
}
247247

248248
if (contentType != null && fileResult.ContentType != contentType)

0 commit comments

Comments
 (0)