Skip to content

Commit 0285cbd

Browse files
author
Christian Bergum Bergersen
committed
Fixes JasperFx#171
1 parent 31454bd commit 0285cbd

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Alba.Testing/Assertions/BodyTextAssertionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void sad_path()
1919
{
2020
var assertion = new BodyTextAssertion("Hey!");
2121
AssertionRunner.Run(assertion, env => env.Response.Write("Hey! You!"))
22-
.Messages.Single().ShouldContain("Expected the content to be 'Hey!'");
22+
.Messages.Single().ShouldBe("Expected the content to be 'Hey!', but was 'Hey! You!'");
2323
}
2424
}
2525
}

src/Alba/Assertions/BodyTextAssertion.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Microsoft.AspNetCore.Http;
2-
31
namespace Alba.Assertions;
42

53
internal sealed class BodyTextAssertion : IScenarioAssertion
@@ -16,7 +14,7 @@ public void Assert(Scenario scenario, AssertionContext context)
1614
var body = context.ReadBodyAsString();
1715
if (!body.Equals(Text))
1816
{
19-
context.AddFailure($"Expected the content to be '{Text}'");
17+
context.AddFailure($"Expected the content to be '{Text}', but was '{body}'");
2018
}
2119
}
2220
}

0 commit comments

Comments
 (0)