From dad0f9b3767a2062fd03149c058e3961223d1eaa Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 30 Oct 2024 17:43:40 -0400 Subject: [PATCH] fix name as requested --- Deployment/ConfigurationBootstrapper.cs | 8 ++++---- deployment.tests/ConfigTests.cs | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Deployment/ConfigurationBootstrapper.cs b/Deployment/ConfigurationBootstrapper.cs index 5b5f244..74cb91e 100644 --- a/Deployment/ConfigurationBootstrapper.cs +++ b/Deployment/ConfigurationBootstrapper.cs @@ -24,7 +24,7 @@ namespace greyn.Deployment */ var actualConfig = JsonConvert.DeserializeObject(File.ReadAllText(confpath)) ?? new ExpandoObject(); var toReturn = new T(); - populateExpando(toReturn, ref actualConfig); + PopulateExpando(toReturn, ref actualConfig); File.WriteAllText(confpath, JsonConvert.SerializeObject(actualConfig, Formatting.Indented)); readFromExpando(ref toReturn, actualConfig); @@ -40,7 +40,7 @@ namespace greyn.Deployment } //TODO: make private but get tests to cooperate... I think that's a c# limitation - internal static void populateExpando(T config, ref ExpandoObject fromFile) + internal static void PopulateExpando(T config, ref ExpandoObject fromFile) { if (config == null) return; if (fromFile == null) @@ -70,14 +70,14 @@ namespace greyn.Deployment var asField = (FieldInfo)memberInfo; if (dictionaryFromExpandoFromFile[asField.Name] is ExpandoObject childMemberField) { - populateExpando(asField.GetValue(config), ref childMemberField); + PopulateExpando(asField.GetValue(config), ref childMemberField); } break; case MemberTypes.Property: var asProperty = (PropertyInfo)memberInfo; if (dictionaryFromExpandoFromFile[asProperty.Name] is ExpandoObject childMemberProperty) { - populateExpando(asProperty.GetValue(config), ref childMemberProperty); + PopulateExpando(asProperty.GetValue(config), ref childMemberProperty); } break; default: diff --git a/deployment.tests/ConfigTests.cs b/deployment.tests/ConfigTests.cs index 8c70791..9ec9786 100644 --- a/deployment.tests/ConfigTests.cs +++ b/deployment.tests/ConfigTests.cs @@ -108,7 +108,7 @@ public class ConfigTests { var toReturn = new AConfigurationType(); var actualConfig = parse(PerfectConfiguration); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(toReturn, ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(toReturn, ref actualConfig); Assert.Pass(); } #endregion @@ -139,7 +139,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); Console.WriteLine("survived populate expando"); var casted = (IDictionary)actualConfig; Console.WriteLine(casted["aValueTypeButNotAField"]); @@ -172,7 +172,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; Console.WriteLine(casted["aField"]); Assert.Pass(); @@ -194,7 +194,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; Console.WriteLine(casted["subtyped"]); Assert.Pass(); @@ -225,7 +225,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; var subtypeCasted = (IDictionary)casted["subtyped"]; Console.WriteLine(subtypeCasted["aValueType"]); @@ -257,7 +257,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; var subtypeCasted = (IDictionary)casted["subtyped"]; Console.WriteLine(subtypeCasted["aValueTypeButNotAField"]); @@ -285,7 +285,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; var subtypeCasted = (IDictionary)casted["subtyped"]; Console.WriteLine(subtypeCasted["anEnumerableType"]); @@ -309,7 +309,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; Assert.IsNull(casted["subtyped"]); } @@ -341,7 +341,7 @@ public class ConfigTests ] } }"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); var casted = (IDictionary)actualConfig; Assert.IsNotNull(casted["hiImHereToo"]); } @@ -349,7 +349,7 @@ public class ConfigTests public void populateExpando_populatesblank() { var actualConfig = parse("{}"); - greyn.Deployment.ConfigurationBootstrapper.populateExpando(new AConfigurationType(), ref actualConfig); + greyn.Deployment.ConfigurationBootstrapper.PopulateExpando(new AConfigurationType(), ref actualConfig); dynamic casted = actualConfig; Console.WriteLine(JsonConvert.SerializeObject(casted, Formatting.Indented));