Skip to content

Commit

Permalink
#66 : Always initialize DaprOptions to ensure valid fluent builder in…
Browse files Browse the repository at this point in the history
…italization
  • Loading branch information
badgeratu committed Oct 27, 2024
1 parent 97b3920 commit e4f7886
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Man.Dapr.Sidekick/Options/DaprOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public DaprOptions()
LogLevel = Process.DaprProcessLogger.DebugLevel;
}

public DaprSidecarOptions Sidecar { get; set; }
public DaprSidecarOptions Sidecar { get; set; } = new();

public DaprPlacementOptions Placement { get; set; }
public DaprPlacementOptions Placement { get; set; } = new();

public DaprSchedulerOptions Scheduler { get; set; }
public DaprSchedulerOptions Scheduler { get; set; } = new();

public DaprSentryOptions Sentry { get; set; }
public DaprSentryOptions Sentry { get; set; } = new();

/// <summary>
/// Creates a deep clone of this instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void Should_create_placement_section_if_null()
var p = new MockDaprPlacementProcess();
var options = new DaprOptions();

Assert.That(options.Placement, Is.Null);
Assert.That(options.Placement, Is.Not.Null);

var newOptions = p.GetProcessOptions(options);
Assert.That(newOptions, Is.Not.Null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void Should_create_scheduler_section_if_null()
var p = new MockDaprSchedulerProcess();
var options = new DaprOptions();

Assert.That(options.Scheduler, Is.Null);
Assert.That(options.Scheduler, Is.Not.Null);

var newOptions = p.GetProcessOptions(options);
Assert.That(newOptions, Is.Not.Null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void Should_create_sentry_section_if_null()
var p = new MockDaprSentryProcess();
var options = new DaprOptions();

Assert.That(options.Sentry, Is.Null);
Assert.That(options.Sentry, Is.Not.Null);

var newOptions = p.GetProcessOptions(options);
Assert.That(newOptions, Is.Not.Null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Should_assign_defaults()
var p = new MockDaprSidecarProcess();
var options = new DaprOptions();

Assert.That(options.Sidecar, Is.Null);
Assert.That(options.Sidecar, Is.Not.Null);

var newOptions = p.GetProcessOptions(options);
Assert.That(newOptions, Is.Not.Null);
Expand Down

0 comments on commit e4f7886

Please sign in to comment.