Skip to content
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
using System.Text;
using EventStore.ClientAPI;
using EventStore.Client.Streams;
using Google.Protobuf;
using GrpcMetadata = EventStore.Core.Services.Transport.Grpc.Constants.Metadata;
using RecordedEvent = EventStore.Client.Streams.ReadResp.Types.ReadEvent.Types.RecordedEvent;

namespace EventStore.Projections.Core.Tests.ClientAPI;

internal static class RecordedEventExtensions
{
public static string DebugDataView(this RecordedEvent source) => Encoding.UTF8.GetString(source.Data);
public static string DebugMetadataView(this RecordedEvent source) => Encoding.UTF8.GetString(source.Metadata);
public static string DebugDataView(this RecordedEvent source) => source.Data.ToStringUtf8();

public static string DebugMetadataView(this RecordedEvent source) => source.CustomMetadata.ToStringUtf8();

public static string EventType(this RecordedEvent source) =>
source.Metadata.TryGetValue(GrpcMetadata.Type, out var eventType)
? eventType
: string.Empty;
}
Loading
Loading