Esempio n. 1
0
 public void Setup()
 {
     _list = new GenericListImpl <string> {
         "oh", "hai"
     };
     _adapter = GenericListAdapter.Create(_list);
 }
Esempio n. 2
0
 public void should_fail_if_not_a_list()
 {
     Assert.Throws <ArgumentException>(() => GenericListAdapter.Create(new object()));
 }
Esempio n. 3
0
        public void should_return_object_if_it_implements_ilist()
        {
            var list = new List <string>();

            GenericListAdapter.Create(list).ShouldBeSameAs(list);
        }
Esempio n. 4
0
 public EnumerableNode(
     Context context,
     string name,
     IValue enumerable,
     CachedMember member,
     INode parent,
     int?index = null)
     : base(name, enumerable, member, parent, context, index)
 {
     _list = new Lazy <IList>(() =>
                              enumerable.Instance.MapOrDefault(x => enumerable.ActualType.IsArray ?
                                                               ArrayAdapter.Create(enumerable) : GenericListAdapter.Create(x)));
     if (SpecifiedType.IsGenericEnumerable)
     {
         _itemType = enumerable.SpecifiedType.GenericEnumerableType;
     }
 }