Ejemplo n.º 1
0
        private static string GetVariableIdentifier(string variableName, bool strict, VariableType type)
        {
            if (variableName != null)
            {
                return(ContextVariable.Get(variableName, strict));
            }

            switch (type)
            {
            case VariableType.Request:
                return(ContextRequest.GetBody(true));

            case VariableType.Response:
                return(ContextResponse.Get(true));

            case VariableType.Undefined:
            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Ejemplo n.º 2
0
 public static string IsRequestBodyNull(bool inline = false)
 {
     return($"string.IsNullOrEmpty({ContextRequest.GetBodyAsString(true)})".ToPolicyCode(inline));
 }