Skip to content

Commit

Permalink
now compiling. two failing matcher tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd committed Aug 20, 2024
1 parent 4347902 commit 2e33645
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,10 @@ public async void GenStringSanitizerQuietExitForAllHttpComponents()

Assert.Equal(0, matcher.CompareHeaderDictionaries(targetUntouchedEntry.Request.Headers, targetEntry.Request.Headers, new HashSet<string>(), new HashSet<string>()));
Assert.Equal(0, matcher.CompareHeaderDictionaries(targetUntouchedEntry.Response.Headers, targetEntry.Response.Headers, new HashSet<string>(), new HashSet<string>()));
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Request.Body, targetEntry.Request.Body));
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Response.Body, targetEntry.Response.Body));

targetUntouchedEntry.Request.TryGetContentType(out var contentType);
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Request.Body, targetEntry.Request.Body, contentType));
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Response.Body, targetEntry.Response.Body, contentType));
Assert.Equal(targetUntouchedEntry.RequestUri, targetEntry.RequestUri);
}

Expand Down Expand Up @@ -769,8 +771,9 @@ public async void BodyStringSanitizerQuietlyExits(string targetValue, string rep
await session.Session.Sanitize(sanitizer);

var resultBodyValue = Encoding.UTF8.GetString(targetEntry.Request.Body);
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Request.Body, targetEntry.Request.Body));
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Response.Body, targetEntry.Response.Body));
targetUntouchedEntry.Request.TryGetContentType(out var contentType);
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Request.Body, targetEntry.Request.Body, contentType));
Assert.Equal(0, matcher.CompareBodies(targetUntouchedEntry.Response.Body, targetEntry.Response.Body, contentType));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ private string GenerateException(RecordEntry request, RecordEntry bestScoreEntry

builder.AppendLine("Body differences:");

CompareBodies(request.Request.Body, bestScoreEntry.Request.Body, builder);
request.Request.TryGetContentType(out var contentType);
CompareBodies(request.Request.Body, bestScoreEntry.Request.Body, contentType, descriptionBuilder: builder);

return builder.ToString();
}
Expand Down

0 comments on commit 2e33645

Please sign in to comment.