Skip to content

Commit

Permalink
Fix unit test to handle default value of LauncherServiceUri
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelvds committed Jan 9, 2024
1 parent 612bc7f commit 29e3579
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,13 @@ public void RandomConfiguration_SerializaAndDeserialize_ShouldPreserveNull()
.RuleForType(typeof(Uri), f => new Uri(f.Internet.Url()).OrNull(f))
.Generate();

// Reset LauncherServiceUri to null for testing purposes
configuration.LauncherServiceUri = null;

var serialized = configuration.Serialize();
var deserialized = LauncherConfiguration.Deserialize(serialized);

// Exclude LauncherServiceUri from comparison as it has a default value now
deserialized.Raw(d => configuration.Raw(c => d.Should().BeEquivalentTo(c, options => options.Excluding(cfg => cfg.LauncherServiceUri))));
deserialized.Should().BeEquivalentTo(deserialized);
deserialized.Should().BeEquivalentTo(configuration, options => options.Excluding(cfg => cfg.LauncherServiceUri));
}
}

[Fact]
public void DifferentCaseInKeys_Deserialize_ShouldPreserveProperties()
{
Expand Down

0 comments on commit 29e3579

Please sign in to comment.