public void VerifyVariableFileGenerationWithSubstitution2(string template) { var metadata = new TerraformHclCloudTemplateHandler().ParseTypes(template); var variables = @"{""test"": ""#{MyVariable}"", ""list"": ""[#{MyListVariable}, 2, 3]"", ""map"": ""{\""key\"": #{MyMap}}""}"; var jsonVariables = TerraformVariableFileGenerator.ConvertStringPropsToObjects( TerraformTemplateFormat.Json, new TestVariableDictionary(), variables, metadata); jsonVariables.Should().Match(@"{""test"": ""#{MyVariable}"",""list"": [#{MyListVariable}, 2, 3],""map"": {""key"": #{MyMap}}}"); }
public void VerifyVariableFileGeneration(string template) { var metadata = new TerraformHclCloudTemplateHandler().ParseTypes(template); var variables = @"{""test"": ""string"", ""list"": ""[1]"", ""map"": ""{\""key\"": \""value\""}""}"; var jsonVariables = TerraformVariableFileGenerator.ConvertStringPropsToObjects( TerraformTemplateFormat.Json, new TestVariableDictionary(), variables, metadata); jsonVariables.Should().Match(@"{""test"": ""string"",""list"": [1],""map"": {""key"": ""value""}}"); // This should be valid json JObject.Parse(jsonVariables); }