From ca2a5a1875feceba4af0d226ee32cf6eed103402 Mon Sep 17 00:00:00 2001 From: David Guida <1432872+mizrael@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:23:42 -0500 Subject: [PATCH] removed newline custom config --- .../Yaml/YamlSerializerTests.cs | 6 +++--- .../Yaml/SerializerBuilderExtensions.cs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.PowerPlatform.PowerApps.Persistence.Tests/Yaml/YamlSerializerTests.cs b/src/Microsoft.PowerPlatform.PowerApps.Persistence.Tests/Yaml/YamlSerializerTests.cs index db6646e7..6d317b5d 100644 --- a/src/Microsoft.PowerPlatform.PowerApps.Persistence.Tests/Yaml/YamlSerializerTests.cs +++ b/src/Microsoft.PowerPlatform.PowerApps.Persistence.Tests/Yaml/YamlSerializerTests.cs @@ -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] @@ -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] @@ -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}"); } } diff --git a/src/Microsoft.PowerPlatform.PowerApps.Persistence/Yaml/SerializerBuilderExtensions.cs b/src/Microsoft.PowerPlatform.PowerApps.Persistence/Yaml/SerializerBuilderExtensions.cs index 68a68948..15002e94 100644 --- a/src/Microsoft.PowerPlatform.PowerApps.Persistence/Yaml/SerializerBuilderExtensions.cs +++ b/src/Microsoft.PowerPlatform.PowerApps.Persistence/Yaml/SerializerBuilderExtensions.cs @@ -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;