Skip to content

Commit

Permalink
fix: failing tests due to serialization indentation options
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelle committed Nov 20, 2024
1 parent 65d62b3 commit 53abb86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ public class EventDataConverterPipelineBuilderTests
[Theory, AutoNSubstituteData]
internal void Should_Call_All_Converters_InReverseOrder(
IEventMetadata metadata,
JsonSerializerOptions options,
FakeEventDataConverter[] converters,
FakeEventDataConverter converter,
EventDataConverterPipelineBuilder sut)
=> sut
.AddConverter(converter)
.AddConverters(converters)
.Build()
.Convert(metadata, doc.RootElement, options)
.Convert(metadata, doc.RootElement, new JsonSerializerOptions())
.Should()
.Be(string.Join(string.Empty, new[] { converter }.Concat(converters).Select(c => c.Val)));
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,27 @@ public class FaultedEventDataConverterTests
[Theory, AutoNSubstituteData]
internal void Should_Return_Converted_Value(
IEventMetadata metadata,
JsonSerializerOptions options,
string expected,
FaultedEventDataConverter sut)
=> sut
.Convert(
metadata,
doc.RootElement,
options,
new JsonSerializerOptions(),
() => expected)
.Should()
.Be(expected);

[Theory, AutoNSubstituteData]
internal void Should_Return_FaultedEvent_When_Exception_IsThrown(
IEventMetadata metadata,
JsonSerializerOptions options,
KeyNotFoundException exception,
FaultedEventDataConverter sut)
=> sut
.Convert(
metadata,
doc.RootElement,
options,
new JsonSerializerOptions(),
() => throw exception)
.Should()
.BeEquivalentTo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class NamedEventConverterTests
internal void Should_Return_Value_FromNext_When_TypeName_IsNotFound(
[Frozen] IEventTypeProvider typeProvider,
IEventMetadata metadata,
JsonSerializerOptions options,
string expected,
NamedEventConverter sut)
{
Expand All @@ -30,7 +29,7 @@ internal void Should_Return_Value_FromNext_When_TypeName_IsNotFound(
.Convert(
metadata,
doc.RootElement,
options,
new JsonSerializerOptions(),
() => expected)
.Should()
.Be(expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,26 @@ public class UnknownEventDataConverterTests
[Theory, AutoNSubstituteData]
internal void Should_Return_Converted_Value_Id_NotNull(
IEventMetadata metadata,
JsonSerializerOptions options,
string expected,
UnknownEventDataConverter sut)
=> sut
.Convert(
metadata,
doc.RootElement,
options,
new JsonSerializerOptions(),
() => expected)
.Should()
.Be(expected);

[Theory, AutoNSubstituteData]
internal void Should_Return_UnknownEvent_When_Value_IsNot_Converted(
IEventMetadata metadata,
JsonSerializerOptions options,
UnknownEventDataConverter sut)
=> sut
.Convert(
metadata,
doc.RootElement,
options,
new JsonSerializerOptions(),
() => null)
.Should()
.BeEquivalentTo(
Expand Down

0 comments on commit 53abb86

Please sign in to comment.