public void add_multiple_values_for_the_same_key() { var response = new SamlResponse(); response.AddAttribute("a", "1"); response.AddAttribute("a", "2"); response.AddAttribute("a", "3"); response.Attributes.Get("a").As <IEnumerable <string> >() .ShouldHaveTheSameElementsAs("1", "2", "3"); }
public void add_multiple_values_for_the_same_key() { var response = new SamlResponse(); response.AddAttribute("a", "1"); response.AddAttribute("a", "2"); response.AddAttribute("a", "3"); response.Attributes.Get("a").As<IEnumerable<string>>() .ShouldHaveTheSameElementsAs("1", "2", "3"); }
public void add_a_single_key_attribute() { var response = new SamlResponse(); response.AddAttribute("a", "1"); response.Attributes.Get("a").ShouldEqual("1"); }
// TODO -- test payload w/o attributes private void readAttributes(SamlResponse response) { XmlElement attributes = find(AttributeStatement, AssertionXsd); if (attributes == null) { return; } foreach (XmlElement attElement in attributes.GetElementsByTagName(Attribute, AssertionXsd)) { string key = attElement.GetAttribute(NameAtt); foreach (XmlElement valueElement in attElement.GetElementsByTagName(AttributeValue, AssertionXsd)) { response.AddAttribute(key, valueElement.InnerText); } } }
// TODO -- test payload w/o attributes private void readAttributes(SamlResponse response) { XmlElement attributes = find(AttributeStatement, AssertionXsd); if (attributes == null) return; foreach (XmlElement attElement in attributes.GetElementsByTagName(Attribute, AssertionXsd)) { string key = attElement.GetAttribute(NameAtt); foreach (XmlElement valueElement in attElement.GetElementsByTagName(AttributeValue, AssertionXsd)) { response.AddAttribute(key, valueElement.InnerText); } } }
public void Attributes(string Key, string Value) { _response.AddAttribute(Key, Value); }