Skip to content

Commit

Permalink
renamed Components to ComponentDefinitions (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizrael authored Apr 17, 2024
1 parent 4b38acd commit aeb8cbb
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/Persistence.Tests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static string GetTestFilePath(string path, bool isControlIdentifiers = fa
Direction = CustomProperty.PropertyDirection.Input, Type = CustomProperty.PropertyType.Data
}
},
@"_TestData/ValidYaml{0}/Components/CustomProperty1.pa.yaml", false
@"_TestData/ValidYaml{0}/ComponentDefinitions/CustomProperty1.pa.yaml", false
},
new object[]
{
Expand All @@ -94,7 +94,7 @@ public static string GetTestFilePath(string path, bool isControlIdentifiers = fa
Direction = CustomProperty.PropertyDirection.Input, Type = CustomProperty.PropertyType.Data
}
},
@"_TestData/ValidYaml{0}/Components/CustomProperty1.pa.yaml", true
@"_TestData/ValidYaml{0}/ComponentDefinitions/CustomProperty1.pa.yaml", true
},
new object[]
{
Expand All @@ -110,7 +110,7 @@ public static string GetTestFilePath(string path, bool isControlIdentifiers = fa
},
}
},
@"_TestData/ValidYaml{0}/Components/CustomProperty2.pa.yaml", false
@"_TestData/ValidYaml{0}/ComponentDefinitions/CustomProperty2.pa.yaml", false
},
new object[]
{
Expand All @@ -126,7 +126,7 @@ public static string GetTestFilePath(string path, bool isControlIdentifiers = fa
},
}
},
@"_TestData/ValidYaml{0}/Components/CustomProperty2.pa.yaml", true
@"_TestData/ValidYaml{0}/ComponentDefinitions/CustomProperty2.pa.yaml", true
},
new object[]
{
Expand All @@ -138,7 +138,7 @@ public static string GetTestFilePath(string path, bool isControlIdentifiers = fa
Direction = CustomProperty.PropertyDirection.Input, Type = CustomProperty.PropertyType.Data
}
},
@"_TestData/ValidYaml{0}/Components/with-two-properties.pa.yaml", false
@"_TestData/ValidYaml{0}/ComponentDefinitions/with-two-properties.pa.yaml", false
},
new object[]
{
Expand All @@ -150,7 +150,7 @@ public static string GetTestFilePath(string path, bool isControlIdentifiers = fa
Direction = CustomProperty.PropertyDirection.Input, Type = CustomProperty.PropertyType.Data
}
},
@"_TestData/ValidYaml{0}/Components/with-two-properties.pa.yaml", true
@"_TestData/ValidYaml{0}/ComponentDefinitions/with-two-properties.pa.yaml", true
},

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
namespace Persistence.Tests.Yaml;

[TestClass]
public class DeserializeComponentTests : TestBase
public class DeserializeComponentDefinitionTests : TestBase
{
[TestMethod]
[DataRow(@"_TestData/ValidYaml{0}/Components/with-custom-properties.pa.yaml", true, 6, 1, 3,
[DataRow(@"_TestData/ValidYaml{0}/ComponentDefinitions/with-custom-properties.pa.yaml", true, 6, 1, 3,
"inputFuncImage", 1, "reqColorParam", "a required color param")]
public void Deserialize_Component_Should_Succeed(string path, bool isControlIdentifiers,
int customPropertiesCount, int childrenCount, int propertiesCount,
Expand Down
8 changes: 4 additions & 4 deletions src/Persistence.Tests/Yaml/DeserializerValidTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ public void Deserialize_Strings()
[TestMethod]
[DataRow(@"_TestData/ValidYaml{0}/Component.pa.yaml", true, "MyCustomComponent", "http://microsoft.com/appmagic/Component", "lorem ipsum", true)]
[DataRow(@"_TestData/ValidYaml{0}/Component.pa.yaml", false, "MyCustomComponent", "http://microsoft.com/appmagic/Component", "lorem ipsum", true)]
[DataRow(@"_TestData/ValidYaml{0}/Components/CommandComponent.pa.yaml", true, "MyCustomCommandComponent", "http://microsoft.com/appmagic/CommandComponent", "lorem ipsum", true)]
[DataRow(@"_TestData/ValidYaml{0}/Components/CommandComponent.pa.yaml", false, "MyCustomCommandComponent", "http://microsoft.com/appmagic/CommandComponent", "lorem ipsum", true)]
public void Deserialize_Component_ShouldSucceed(
[DataRow(@"_TestData/ValidYaml{0}/ComponentDefinitions/CommandComponent.pa.yaml", true, "MyCustomCommandComponent", "http://microsoft.com/appmagic/CommandComponent", "lorem ipsum", true)]
[DataRow(@"_TestData/ValidYaml{0}/ComponentDefinitions/CommandComponent.pa.yaml", false, "MyCustomCommandComponent", "http://microsoft.com/appmagic/CommandComponent", "lorem ipsum", true)]
public void Deserialize_ComponentDefinition_ShouldSucceed(
string path, bool isControlIdentifiers,
string expectedName,
string expectedTemplateId,
Expand Down Expand Up @@ -436,7 +436,7 @@ public void Deserialize_Should_AddGalleryTemplate(string path, bool isControlIde

[TestMethod]
[DynamicData(nameof(ComponentCustomProperties_Data), typeof(TestBase))]
public void Deserialize_ShouldParseYamlForComponentCustomProperties(CustomProperty[] expectedCustomProperties, string yamlFile, bool isControlIdentifiers)
public void Deserialize_ShouldParseYamlForComponentDefinitionCustomProperties(CustomProperty[] expectedCustomProperties, string yamlFile, bool isControlIdentifiers)
{
var expectedYaml = File.ReadAllText(GetTestFilePath(yamlFile, isControlIdentifiers));
var deserializer = CreateDeserializer(isControlIdentifiers);
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence.Tests/Yaml/ValidSerializerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void Serialize_ShouldCreateValidYamlForComponentCustomProperties(CustomPr
[DataRow(ComponentType.Canvas, "lorem ipsum dolor", true, "Control: Component\nName: Component1\nDescription: lorem ipsum dolor\nAccessAppScope: true\n")]
[DataRow(ComponentType.Canvas, "", true, "Control: Component\nName: Component1\nAccessAppScope: true\n")]
[DataRow(ComponentType.Command, "", true, "Control: Component\nName: Component1\nType: Command\nAccessAppScope: true\n")]
public void Serialize_ShouldCreateValidYamlForComponent(ComponentType componentType, string description, bool accessAppScope, string expectedYaml)
public void Serialize_ShouldCreateValidYamlForComponentDefinitions(ComponentType componentType, string description, bool accessAppScope, string expectedYaml)
{
var component = (ComponentDefinition)ControlFactory.Create("Component1", "Component");
component.Should().NotBeNull();
Expand Down

0 comments on commit aeb8cbb

Please sign in to comment.