Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes JasperFx/alba#171 #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Alba.Testing/Assertions/BodyTextAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void sad_path()
{
var assertion = new BodyTextAssertion("Hey!");
AssertionRunner.Run(assertion, env => env.Response.Write("Hey! You!"))
.Messages.Single().ShouldContain("Expected the content to be 'Hey!'");
.Messages.Single().ShouldBe("Expected the content to be 'Hey!', but was 'Hey! You!'");
}
}
}
4 changes: 1 addition & 3 deletions src/Alba/Assertions/BodyTextAssertion.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.AspNetCore.Http;

namespace Alba.Assertions;

internal sealed class BodyTextAssertion : IScenarioAssertion
Expand All @@ -16,7 +14,7 @@ public void Assert(Scenario scenario, AssertionContext context)
var body = context.ReadBodyAsString();
if (!body.Equals(Text))
{
context.AddFailure($"Expected the content to be '{Text}'");
context.AddFailure($"Expected the content to be '{Text}', but was '{body}'");
}
}
}
Loading