The parameters macro supports passing parameters to resources.
Inheritance: IMacro
コード例 #1
0
        public async Task Parameters_SubstituteTokensInString_NotFound()
        {
            var context = new TaskContext
            {
                Parameters = new Dictionary<string, string>()
                {
                    { "Param1", "Value1" }
                }
            };

            var macro = new ParametersMacro();
            var input = "Hello_$parameters['Param2']";
            await macro.SubstituteTokensInString(null, context, input);
        }
コード例 #2
0
        public async Task Parameters_SubstituteTokensInString_Success()
        {
            var context = new TaskContext
            {
                Parameters = new Dictionary<string, string>()
                {
                    { "Param1", "Param2" },
                    { "Param2", "Param3" },
                    { "Param3", "Param4" }
                }
            };

            var macro = new ParametersMacro();
            var input = "Hello_$parameters[$parameters['Param1']]";
            var output = await macro.SubstituteTokensInString(null, context, input);

            Assert.AreEqual("Hello_Param3", output);
        }