<PackageReference Include="NUnit" Version="3.0.0-alpha" />

PropertyBag

A PropertyBag represents a collection of name value pairs that allows duplicate entries with the same key. Methods are provided for adding a new pair as well as for setting a key to a single value. All keys are strings but _values may be of any type. Null _values are not permitted, since a null entry represents the absence of the key.
public IList this[string key] { get; set; }

Gets or sets the list of _values for a particular key

public ICollection<string> Keys { get; }

Gets a collection containing all the keys in the property set

public PropertyBag()

public void Add(string key, object value)

Adds a key/value pair to the property set

public XmlNode AddToXml(XmlNode parentNode, bool recursive)

Returns an XmlNode representing the PropertyBag after adding it as a child of the supplied parent node.

public bool ContainsKey(string key)

Gets a flag indicating whether the specified key has any entries in the property set.

public object Get(string key)

Gets a single value for a key, using the first one if multiple _values are present and returning null if the value is not found.

public void Set(string key, object value)

Sets the value for a key, removing any other _values that are already in the property set.

public XmlNode ToXml(bool recursive)

Returns an XmlNode representating the current PropertyBag.