public static IEnumerable <object[]> GetAndSetValuesOnChildOnObjectData()
        {
            var list = new List <object[]>();

            {
                var codeData = new JsonData();
                codeData["S3Bucket"] = "";
                codeData["S3Key"]    = "/currentProject";

                var rootData = new JsonData();
                rootData["Code"] = codeData;

                var source = new JsonTemplateParser.JsonUpdatableResourceDataSource(rootData);
                list.Add(new object[] { source });
            }
            {
                var codeData = new YamlMappingNode();
                codeData.Children.Add("S3Bucket", new YamlScalarNode(""));
                codeData.Children.Add("S3Key", new YamlScalarNode("/currentProject"));

                var rootData = new YamlMappingNode();
                rootData.Children.Add("Code", codeData);

                var source = new YamlTemplateParser.YamlUpdatableResourceDataSource(rootData);
                list.Add(new object[] { source });
            }

            return(list);
        }
        public static IEnumerable <object[]> IgnoreResourceWithInlineCodeData()
        {
            const string InlineCode = @"{ 'Fn::Join': ['', [
  'var response = require('cfn-response');',
  'exports.handler = function(event, context) {',
  '  var input = parseInt(event.ResourceProperties.Input);',
  '  var responseData = {Value: input * 5};',
  '  response.send(event, context, response.SUCCESS, responseData);',
  '};'
]]}";
            var          list       = new List <object[]>();

            {
                var codeData = new JsonData();
                codeData["ZipFile"] = InlineCode;

                var rootData = new JsonData();
                rootData["Code"] = codeData;

                var source = new JsonTemplateParser.JsonUpdatableResourceDataSource(null, rootData);
                list.Add(new object[] { source });
            }
            {
                var codeData = new YamlMappingNode();
                codeData.Children.Add("ZipFile", new YamlScalarNode(InlineCode));

                var rootData = new YamlMappingNode();
                rootData.Children.Add("Code", codeData);

                var source = new YamlTemplateParser.YamlUpdatableResourceDataSource(null, rootData);
                list.Add(new object[] { source });
            }

            return(list);
        }
        public static IEnumerable <object[]> GetNullValueAndSetValuesOnChildOnObjectData()
        {
            var list = new List <object[]>();

            {
                var rootData = new JsonData();

                var source = new JsonTemplateParser.JsonUpdatableResourceDataSource(rootData);
                list.Add(new object[] { source });
            }
            {
                var rootData = new YamlMappingNode();

                var source = new YamlTemplateParser.YamlUpdatableResourceDataSource(rootData);
                list.Add(new object[] { source });
            }

            return(list);
        }
        public static IEnumerable <object[]> GetAndSetValuesOnRootData()
        {
            var list = new List <object[]>();

            {
                var rootData = new JsonData();
                rootData["CodeUri"] = "/home/code";
                var source = new JsonTemplateParser.JsonUpdatableResourceDataSource(rootData);
                list.Add(new object[] { source });
            }
            {
                var rootData = new YamlMappingNode();
                rootData.Children.Add("CodeUri", new YamlScalarNode("/home/code"));

                var source = new YamlTemplateParser.YamlUpdatableResourceDataSource(rootData);
                list.Add(new object[] { source });
            }

            return(list);
        }