コード例 #1
0
        public void HasEnumeratorOfKeyValuePairs()
        {
            var enumerator = new OptionDictionary <string, string>
            {
                { "key1", "value1" },
                { "key2", "value2" },
                { "key3", "value3" }
            }.GetEnumerator();
            var enumerated = new List <KeyValuePair <string, Option <string> > >();

            while (enumerator.MoveNext())
            {
                enumerated.Add(enumerator.Current);
            }

            Assert.That(
                enumerated,
                Is.EquivalentTo(new[]
            {
                new KeyValuePair <string, Option <string> >("key1", "value1"),
                new KeyValuePair <string, Option <string> >("key2", "value2"),
                new KeyValuePair <string, Option <string> >("key3", "value3")
            }));
        }