src/GenFx.Components.Tests/ListEntityBaseTest.cs
/// <summary>
/// Tests that the <see cref="ICollection.CopyTo"/> method works correctly.
/// </summary>
Tests that the  method works correctly.
Tests that the method works correctly .
[Fact]
        public void ListEntityBase_CopyTo()
        {
            TestEntity entity = new TestEntity();
            entity.InnerList.AddRange(Enumerable.Range(3, 3).Cast<object>());
            int[] destination = new int[entity.InnerList.Count];
            ((ICollection)entity).CopyTo(destination, 0);
            Assert.Equal(new int[] { 3, 4, 5 }, destination);
            destination = new int[entity.InnerList.Count - 1];
            ((ICollection)entity).CopyTo(destination, 1);
            Assert.Equal(new int[] { 4, 5 }, destination);
            Assert.Throws<ArgumentNullException>(() => ((ICollection)entity).CopyTo(null, 1));
            Assert.Throws<ArgumentOutOfRangeException>(() => ((ICollection)entity).CopyTo(destination, 3));
            Assert.Throws<ArgumentOutOfRangeException>(() => ((ICollection)entity).CopyTo(destination, -1));
        }
[ Fact ] public void ListEntityBase_CopyTo ( ) { TestEntity entity = new TestEntity ( ) ; entity . InnerList . AddRange ( Enumerable . Range ( 3 , 3 ) . Cast < object > ( ) ) ; int [ ] destination = new int [ entity . InnerList . Count ] ; ( ( ICollection ) entity ) . CopyTo ( destination , 0 ) ; Assert . Equal ( new int [ ] { 3 , 4 , 5 } , destination ) ; destination = new int [ entity . InnerList . Count - 1 ] ; ( ( ICollection ) entity ) . CopyTo ( destination , 1 ) ; Assert . Equal ( new int [ ] { 4 , 5 } , destination ) ; Assert . Throws < ArgumentNullException > ( ( ) => ( ( ICollection ) entity ) . CopyTo ( null , 1 ) ) ; Assert . Throws < ArgumentOutOfRangeException > ( ( ) => ( ( ICollection ) entity ) . CopyTo ( destination , 3 ) ) ; Assert . Throws < ArgumentOutOfRangeException > ( ( ) => ( ( ICollection ) entity ) . CopyTo ( destination , - 1 ) ) ; }
Tests that the  method works correctly.
Tests that the method works correctly .