Exemplo n.º 1
0
        public void Paged_CopyTo()
        {
            // Arrange
            var items    = new[] { new User(Guid.NewGuid(), "one", "one"), new User(Guid.NewGuid(), "two", "two") };
            var page     = 2;
            var quantity = 4;
            var total    = 6;
            var paged    = new Paged <User>(items, page, quantity, total);
            var result   = new User[3];

            // Act
            paged.CopyTo(result, 1);

            // Assert
            result.Count().Should().Be(3);
            result[0].Should().BeNull();
            result[1].Should().BeEquivalentTo(items[0]);
            result[2].Should().BeEquivalentTo(items[1]);
        }
Exemplo n.º 2
0
        public void Paged_CopyTo()
        {
            // Arrange
            var items    = new[] { EntityHelper.CreateUser("one"), EntityHelper.CreateUser("two") };
            var page     = 2;
            var quantity = 4;
            var total    = 6;
            var paged    = new Paged <PimsUser>(items, page, quantity, total);
            var result   = new PimsUser[3];

            // Act
            paged.CopyTo(result, 1);

            // Assert
            result.Count().Should().Be(3);
            result[0].Should().BeNull();
            result[1].Should().BeEquivalentTo(items[0]);
            result[2].Should().BeEquivalentTo(items[1]);
        }