Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests #526

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ namespace Microsoft.PowerPlatform.PowerApps.Persistence.Tests.Yaml;
public class YamlDeserializerTests
{
[TestMethod]
public void Deserialize_ShouldParseSimpleStructure()
[DataRow("I am a screen with spaces", "42")]
[DataRow("NoSpaces", "-50")]
[DataRow("Yaml : | > ", "")]
[DataRow("Text`~!@#$%^&*()_-+=", ":")]
[DataRow("Text[]{};':\",.<>?/\\|", "@")]
[DataRow("こんにちは", "#")]
[DataRow("Cos'è questo?", "---")]
public void Deserialize_ShouldParseSimpleStructure(string textValue, string xValue)
{
var graph = new Screen()
{
Name = "Screen1",
Properties = new Dictionary<string, ControlPropertyValue>()
{
{ "Text", new() { Value = "I am a screen" } },
{ "X", new() { Value = "42" } },
{ "Text", new() { Value = textValue } },
{ "X", new() { Value = xValue } },
{ "Y", new() { Value = "71" } },
},
};
Expand All @@ -36,8 +43,8 @@ public void Deserialize_ShouldParseSimpleStructure()
sut.Properties.Should().NotBeNull()
.And.HaveCount(3)
.And.ContainKeys("Text", "X", "Y");
sut.Properties["Text"].Value.Should().Be("I am a screen");
sut.Properties["X"].Value.Should().Be("42");
sut.Properties["Text"].Value.Should().Be(textValue);
sut.Properties["X"].Value.Should().Be(xValue);
sut.Properties["Y"].Value.Should().Be("71");
}

Expand Down
4 changes: 4 additions & 0 deletions src/PAModel/Microsoft.PowerPlatform.Formulas.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.PowerPlatform.PowerApps.Persistence\Microsoft.PowerPlatform.PowerApps.Persistence.csproj" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions src/PAModel/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"microsoft.powerplatform.powerapps.persistence": {
"type": "Project",
"dependencies": {
"YamlDotNet": "[15.1.0, )"
}
}
}
}
Expand Down
Loading