public void TestThrowOnCopyTo() { CoalescableAffector coalescable = new CoalescableAffector(); NoncoalescableAffector noncoalescable = new NoncoalescableAffector(); AffectorCollection <int> affectors = new AffectorCollection <int>(); affectors.Add(coalescable); affectors.Add(noncoalescable); IParticleAffector <int>[] array = new IParticleAffector <int> [3]; Assert.Throws <IndexOutOfRangeException>( delegate() { affectors.CopyTo(array, 2); } ); }
public void TestCopyTo() { CoalescableAffector coalescable = new CoalescableAffector(); NoncoalescableAffector noncoalescable = new NoncoalescableAffector(); AffectorCollection <int> affectors = new AffectorCollection <int>(); affectors.Add(coalescable); affectors.Add(noncoalescable); IParticleAffector <int>[] array = new IParticleAffector <int> [3]; affectors.CopyTo(array, 1); Assert.IsNull(array[0]); Assert.Contains(coalescable, array); Assert.Contains(noncoalescable, array); }