Exemple #1
0
 public static void ShouldCreateArrayFromStringValues()
 {
     ArmExpressionEvaluatorTests.AssertEvaluatorTest(
         "createArray('a', 'b', 'c')",
         new object[] { "a", "b", "c" }
         );
 }
Exemple #2
0
 public static void ShouldCreateArrayFromIntValues()
 {
     ArmExpressionEvaluatorTests.AssertEvaluatorTest(
         "createArray(1, 2, 3)",
         new object[] { 1, 2, 3 }
         );
 }
Exemple #3
0
 public static void EmptyArrayShouldReturnTrue()
 {
     // "test-output": {
     //   "type": "string",
     //   "value": "[empty(intersection(createArray('aaa'), createArray('bbb')))]"
     // },
     //
     // Name             Type                       Value
     // ===============  =========================  ==========
     // test-output      Bool                       False
     ArmExpressionEvaluatorTests.AssertEvaluatorTest(
         "empty(intersection(createArray('aaa'), createArray('bbb')))",
         true
         );
 }
Exemple #4
0
 public static void InvokingWithNoArgumentsShouldThrow()
 {
     // "test-output": {
     //   "type": "array",
     //   "value": "[createArray()]"
     // },
     //
     // New-AzResourceGroupDeployment : 09:49:49 - The deployment 'arm_functions' failed with error(s). Showing 1 out of 1 error(s).
     // Status Message: Unable to evaluate template outputs: 'test-output'. Please see error details and deployment operations. Please see https://aka.ms/arm-debug for usage details. (Code: DeploymentOutputEvaluationFailed)
     //  - The template output 'test-output' is not valid: Unable to evaluate template language function 'createArray'. At least one parameter should be provided. Please see https://aka.ms/arm-template-expressions for usage details.. (Code:DeploymentOutputEvaluationFailed)
     ArmExpressionEvaluatorTests.AssertEvaluatorTestThrows(
         "createArray()",
         typeof(InvalidOperationException),
         "No method overloads match the arguments.\r\n" +
         "\r\n" +
         "Arguments are:\r\n" +
         "System.Object[]"
         );
 }