示例#1
0
 public SetHeaderParameter(string name, string value, ExistsAction?existsAction) : base("set-header")
 {
     if (value != null)
     {
         _value = new Value(value);
     }
     Attributes.Add("name", name);
     Attributes.Add("exists-action", ExistsActionMapper.Map(existsAction));
 }
        public void CreatesCorrectPolicy(string parameterName, string parameterValue, ExistsAction existsAction)
        {
            var basePolicy = new SetQueryParameter(parameterName, parameterValue, existsAction);
            var xml        = basePolicy.GetXml().ToString();

            xml.Should().Be(
                $@"<set-query-parameter name=""{parameterName}"" exists-action=""{ExistsActionMapper.Map(existsAction)}"">
  <value>{parameterValue}</value>
</set-query-parameter>");
        }
示例#3
0
 public SetQueryParameter(string name, string value, ExistsAction?existsAction) : base("set-query-parameter")
 {
     _value = new Value(value);
     Attributes.Add("name", name);
     Attributes.Add("exists-action", ExistsActionMapper.Map(existsAction));
 }