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>"); }
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)); }