Skip to content
Merged
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
3 changes: 1 addition & 2 deletions src/Alba/Assertions/NoHeaderValueAssertion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ public NoHeaderValueAssertion(string headerKey)
public void Assert(Scenario scenario, AssertionContext context)
{
var headers = context.HttpContext.Response.Headers;
if (headers.ContainsKey(_headerKey))
if (headers.TryGetValue(_headerKey, out var values))
{
var values = headers[_headerKey];
var valueText = values.Select(x => "'" + x + "'").Aggregate((s1, s2) => $"{s1}, {s2}");
context.AddFailure($"Expected no value for header '{_headerKey}', but found values {valueText}");
}
Expand Down
Loading