Exemplo n.º 1
0
            public void When_CopyingToArray_Expect_CopiedToArray()
            {
                // Arrange
                OrderBy orderBy1 = new OrderBy(nameof(TestClass.Property1));
                OrderBy orderBy2 = new OrderBy(nameof(TestClass.Property2));
                OrderBy orderBy3 = new OrderBy(nameof(TestClass.Property3));

                Ordering <TestClass> ordering = new Ordering <TestClass>
                {
                    orderBy1,
                    orderBy2,
                    orderBy3,
                };

                OrderBy[] array = new OrderBy[5];

                // Act
                ordering.CopyTo(array, 1);

                // Assert
                Assert.Null(array[0]);
                Assert.Equal(orderBy1, array[1]);
                Assert.Equal(orderBy2, array[2]);
                Assert.Equal(orderBy3, array[3]);
                Assert.Null(array[4]);
            }