diff --git a/src/Persistence.Tests/TestBase.cs b/src/Persistence.Tests/TestBase.cs index f6f459a8..a0abfaf0 100644 --- a/src/Persistence.Tests/TestBase.cs +++ b/src/Persistence.Tests/TestBase.cs @@ -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[] { @@ -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[] { @@ -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[] { @@ -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[] { @@ -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[] { @@ -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 }, }; diff --git a/src/Persistence.Tests/Yaml/DeserializeComponentTests.cs b/src/Persistence.Tests/Yaml/DeserializeComponentDefinitionTests.cs similarity index 91% rename from src/Persistence.Tests/Yaml/DeserializeComponentTests.cs rename to src/Persistence.Tests/Yaml/DeserializeComponentDefinitionTests.cs index b5310923..f9302c23 100644 --- a/src/Persistence.Tests/Yaml/DeserializeComponentTests.cs +++ b/src/Persistence.Tests/Yaml/DeserializeComponentDefinitionTests.cs @@ -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, diff --git a/src/Persistence.Tests/Yaml/DeserializerValidTests.cs b/src/Persistence.Tests/Yaml/DeserializerValidTests.cs index ec63f3f9..d7c3639e 100644 --- a/src/Persistence.Tests/Yaml/DeserializerValidTests.cs +++ b/src/Persistence.Tests/Yaml/DeserializerValidTests.cs @@ -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, @@ -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); diff --git a/src/Persistence.Tests/Yaml/ValidSerializerTests.cs b/src/Persistence.Tests/Yaml/ValidSerializerTests.cs index e01747fe..b5ce2c4f 100644 --- a/src/Persistence.Tests/Yaml/ValidSerializerTests.cs +++ b/src/Persistence.Tests/Yaml/ValidSerializerTests.cs @@ -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(); diff --git a/src/Persistence.Tests/_TestData/ValidYaml-CI/Components/CommandComponent.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/CommandComponent.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml-CI/Components/CommandComponent.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/CommandComponent.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml-CI/Components/CustomProperty1.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/CustomProperty1.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml-CI/Components/CustomProperty1.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/CustomProperty1.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml-CI/Components/CustomProperty2.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/CustomProperty2.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml-CI/Components/CustomProperty2.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/CustomProperty2.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml-CI/Components/with-custom-properties.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/with-custom-properties.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml-CI/Components/with-custom-properties.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/with-custom-properties.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml-CI/Components/with-two-properties.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/with-two-properties.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml-CI/Components/with-two-properties.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml-CI/ComponentDefinitions/with-two-properties.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml/Components/CommandComponent.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/CommandComponent.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml/Components/CommandComponent.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/CommandComponent.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml/Components/CustomProperty1.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/CustomProperty1.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml/Components/CustomProperty1.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/CustomProperty1.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml/Components/CustomProperty2.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/CustomProperty2.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml/Components/CustomProperty2.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/CustomProperty2.pa.yaml diff --git a/src/Persistence.Tests/_TestData/ValidYaml/Components/with-two-properties.pa.yaml b/src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/with-two-properties.pa.yaml similarity index 100% rename from src/Persistence.Tests/_TestData/ValidYaml/Components/with-two-properties.pa.yaml rename to src/Persistence.Tests/_TestData/ValidYaml/ComponentDefinitions/with-two-properties.pa.yaml