public void NullInput2() { IReadOnlyList <int> list = null; new Action( () => FastLinq.Cast <int, object>(list)) .Should() .Throw <ArgumentNullException>(); }
public void Nominal() { int[] list = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.Cast <object>(list), FastLinq.Cast <object>(list), itemNotInTheCollection: null, enforceWritable: false); }
public void NullInput() { IList list = null; new Action( () => FastLinq.Cast <string>(list)) .Should() .Throw <ArgumentNullException>(); }
public void CannotCast() { IList list = new[] { 1, 2, 3 }; new Action( // ReSharper disable once ReturnValueOfPureMethodIsNotUsed () => FastLinq.Cast <string>(list).ToArray()) .Should() .Throw <InvalidCastException>(); }
public void Nominal2() { IReadOnlyList <int> list = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.Cast <object>(list), FastLinq.Cast <int, object>(list), itemNotInTheCollection: (object)0, enforceWritable: false); }
public void Array_FastLinq1() { var _ = FastLinq.Cast <object>(this.array); if (EnumerateAfterwards) { foreach (var __ in _) { ; } } }
public void List_FastLinq1() { var _ = FastLinq.Cast <object>(this.list); if (EnumerateAfterwards) { foreach (var __ in _) { ; } } }
public void Collection_FastLinq1() { var _ = FastLinq.Cast <object>((ICollection)this.list); if (EnumerateAfterwards) { foreach (var __ in _) { ; } } }
public void IList_FastLinq2() { var _ = FastLinq.Cast <int, object>(this.ilist); if (EnumerateAfterwards) { foreach (var __ in _) { ; } } }
public void Collection_FastLinq2() { var _ = FastLinq.Cast <int, object>(this.collection); if (EnumerateAfterwards) { foreach (var __ in _) { ; } } }
public void Setup() { switch (this.ItemType) { case UnderlyingItemType.Array: this.underlying = Enumerable.Range(0, this.SizeOfInput).Select(i => i.ToString()).ToArray(); break; case UnderlyingItemType.List: this.underlying = Enumerable.Range(0, this.SizeOfInput).Select(i => i.ToString()).ToList(); break; default: throw new ArgumentOutOfRangeException(); } this.CastList = FastLinq.Cast <object>( this.underlying); }