private static void ShouldDeserialize(ErrorCause error, bool nullReason = false) { error.Should().NotBeNull(); error.Type.Should().NotBeNullOrEmpty(); if (nullReason) { error.Reason.Should().BeNull(); } else { error.Reason.Should().NotBeNullOrEmpty(); } }
private void AssertMetadata(string origin, ErrorCause errorMetadata) { errorMetadata.Should().NotBeNull(origin); errorMetadata.Grouped.Should().BeTrue(origin); errorMetadata.Phase.Should().Be("query", origin); errorMetadata.LicensedExpiredFeature.Should().Be("ml", origin); errorMetadata.Index.Should().Be("index", origin); errorMetadata.IndexUUID.Should().NotBeNullOrWhiteSpace(origin); errorMetadata.ResourceType.Should().NotBeNullOrWhiteSpace(origin); errorMetadata.ResourceId.Should().HaveCount(1, origin); errorMetadata.Shard.Should().Be(1, origin); errorMetadata.Line.Should().Be(12, origin); errorMetadata.Column.Should().Be(199, origin); errorMetadata.BytesWanted.Should().BeGreaterThan(1, origin); errorMetadata.BytesLimit.Should().BeGreaterThan(1, origin); errorMetadata.ScriptStack.Should().HaveCount(1, origin); errorMetadata.Script.Should().NotBeNullOrWhiteSpace(origin); errorMetadata.Language.Should().NotBeNullOrWhiteSpace(origin); AssertFailedShards(origin, errorMetadata.FailedShards); }
private static void AssertCausedBy(string origin, ErrorCause causedBy) { causedBy.Should().NotBeNull(origin); causedBy.Type.Should().NotBeNullOrWhiteSpace(origin); causedBy.Reason.Should().NotBeNullOrWhiteSpace(origin); }