Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Elastic.Xunit.XunitPlumbing;
using Elasticsearch.Net;
using FluentAssertions;
using FluentAssertions.Execution;
using Nest;
using Tests.Core.Client;
using Tests.Core.Extensions;
Expand Down Expand Up @@ -53,7 +54,20 @@ protected override Task AssertOnAllResponses(Action<TResponse> assert)
return;
}

assert(r);
using (var scope = new AssertionScope())
{
assert(r);
var failures = scope.Discard();
if (failures.Length <= 0) return;

var failure = failures[0];
scope.AddReportable("Failure", failure);
scope.AddReportable("DebugInformation", r.DebugInformation);
scope.FailWith( $@"{{Failure}}
Response Under Test:
{{DebugInformation}}");

}
});
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Tests/Tests/Search/Request/FieldsUsageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ [I] protected Task FieldsAreReturned() => this.AssertOnAllResponses(r =>
var name = fieldValues.Value<string>(Field<Project>(p => p.Name));
name.Should().NotBeNullOrWhiteSpace();


var commits = fieldValues.ValueOf<Project, float?>(p => p.NumberOfCommits);
commits.Should().BeGreaterThan(0);

Expand Down