Skip to content

Commit

Permalink
removed newline custom config
Browse files Browse the repository at this point in the history
  • Loading branch information
mizrael committed Jan 24, 2024
1 parent 9f61e22 commit ca2a5a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void Serialize_ShouldCreateValidYamlForSimpleStructure()
var serializer = YamlSerializationFactory.CreateSerializer();

var sut = serializer.Serialize(graph);
sut.Should().Be("Screen: \nName: Screen1\nProperties:\n Text: I am a screen\n");
sut.Should().Be($"Screen: {Environment.NewLine}Name: Screen1{Environment.NewLine}Properties:{Environment.NewLine} Text: I am a screen{Environment.NewLine}");
}

[TestMethod]
Expand Down Expand Up @@ -63,7 +63,7 @@ public void Serialize_ShouldCreateValidYamlWithChildNodes()
var serializer = YamlSerializationFactory.CreateSerializer();

var sut = serializer.Serialize(graph);
sut.Should().Be("Screen: \nName: Screen1\nProperties:\n Text: I am a screen\nControls:\n- Label: \n Name: Label1\n Properties:\n Text: lorem ipsum\n- Button: \n Name: Button1\n Properties:\n Text: click me\n X: 100\n Y: 200\n");
sut.Should().Be($"Screen: {Environment.NewLine}Name: Screen1{Environment.NewLine}Properties:{Environment.NewLine} Text: I am a screen{Environment.NewLine}Controls:{Environment.NewLine}- Label: {Environment.NewLine} Name: Label1{Environment.NewLine} Properties:{Environment.NewLine} Text: lorem ipsum{Environment.NewLine}- Button: {Environment.NewLine} Name: Button1{Environment.NewLine} Properties:{Environment.NewLine} Text: click me{Environment.NewLine} X: 100{Environment.NewLine} Y: 200{Environment.NewLine}");
}

[TestMethod]
Expand All @@ -82,6 +82,6 @@ public void Serialize_ShouldCreateValidYamlForCustomControl()
var serializer = YamlSerializationFactory.CreateSerializer();

var sut = serializer.Serialize(graph);
sut.Should().Be("Control: http://localhost/#customcontrol\nName: CustomControl1\nProperties:\n Text: I am a custom control\n");
sut.Should().Be($"Control: http://localhost/#customcontrol{Environment.NewLine}Name: CustomControl1{Environment.NewLine}Properties:{Environment.NewLine} Text: I am a custom control{Environment.NewLine}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public static SerializerBuilder WithFirstClassModels(this SerializerBuilder buil
.WithNamingConvention(PascalCaseNamingConvention.Instance)
.WithTypeConverter(new ControlPropertyConverter())
.WithTypeConverter(new ControlPropertiesCollectionConverter())
.WithNewLine("\n")
.ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitEmptyCollections | DefaultValuesHandling.OmitNull);

return builder;
Expand Down

0 comments on commit ca2a5a1

Please sign in to comment.