Skip to content

Commit

Permalink
fixed filename.
Browse files Browse the repository at this point in the history
minor changes.
  • Loading branch information
RagingKore committed May 29, 2024
1 parent 299ef6c commit 1fadfd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/EventStore.Plugins/Diagnostics/PluginDiagnosticsData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public enum PluginDiagnosticsDataCollectionMode {
/// By default it is a snapshot and will override previously collected data, by event name.
/// </summary>
public readonly record struct PluginDiagnosticsData() : IComparable<PluginDiagnosticsData>, IComparable {
public static PluginDiagnosticsData None { get; } = new() { Source = null!, Data = null! };
public static PluginDiagnosticsData None { get; } = new() { Data = null! };

/// <summary>
/// The source of the event that matches the DiagnosticsName.
/// </summary>
public required string Source { get; init; }
public string Source { get; init; } = string.Empty;

/// <summary>
/// The name of the event. The default is PluginDiagnosticsData.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ReSharper disable AccessToDisposedClosure

using EventStore.Plugins.Diagnostics;

namespace EventStore.Plugins.Tests.Diagnostics;
Expand All @@ -25,18 +23,16 @@ public void can_get_default_value_from_data(dynamic expectedValue) =>

static void gets_value_from_data<T>(T expectedValue) {
var sut = new PluginDiagnosticsData {
Source = "",
Data = new() { ["value"] = expectedValue }
Data = new() { ["value"] = expectedValue }
};

sut.GetValue<T>("value").Should()
.BeEquivalentTo(expectedValue, $"because the retrieved value should be {typeof(T).Name}");
}

static void gets_default_value_from_data<T>(T expectedValue) {
var sut = new PluginDiagnosticsData {
Source = "",
Data = new()
Data = new()
};

sut.GetValue("missing-value", defaultValue: expectedValue)
Expand Down

0 comments on commit 1fadfd9

Please sign in to comment.