public void Setup() { _list = new GenericListImpl <string> { "oh", "hai" }; _adapter = GenericListAdapter.Create(_list); }
public void should_fail_if_not_a_list() { Assert.Throws <ArgumentException>(() => GenericListAdapter.Create(new object())); }
public void should_return_object_if_it_implements_ilist() { var list = new List <string>(); GenericListAdapter.Create(list).ShouldBeSameAs(list); }
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; } }