public void can_enumerate_one_pair() { var rvm = new Rv.Message(); rvm.AddField("custom", "value"); var headers = new ReadOnlyRvMessageHeaders(rvm); Assert.AreEqual(1, headers.Count()); Assert.AreEqual(new KeyValuePair <string, string>("custom", "value"), headers.First()); }
public void can_enumerate_multiple_pairs() { var rvm = new Rv.Message(); rvm.AddField("custom1", "value1"); rvm.AddField("custom2", "value2"); var headers = new ReadOnlyRvMessageHeaders(rvm); Assert.AreEqual(new KeyValuePair <string, string>("custom1", "value1"), headers.First()); Assert.AreEqual(new KeyValuePair <string, string>("custom2", "value2"), headers.ElementAt(1)); Assert.AreEqual(2, headers.Count()); }