コード例 #1
0
        public void InsertAfterPageProducesNothing()
        {
            var people = _generator.Take(100).ToArray();

            _source.AddRange(people);
            var expected = people.Take(25).ToArray();

            _source.InsertRange(_generator.Take(100), 50);
            _results.Data.Items.ShouldAllBeEquivalentTo(expected);
        }
コード例 #2
0
ファイル: PageFixture.cs プロジェクト: mgnslndh/DynamicData
        public void InsertAfterPageProducesNothing()
        {
            var people = _generator.Take(100).ToArray();

            _source.AddRange(people);
            var expected = people.Take(25).ToArray();

            _source.InsertRange(_generator.Take(100), 50);
            CollectionAssert.AreEqual(expected, _results.Data.Items);
        }
コード例 #3
0
        public void EachItemChangeInokesTheCallbac2()
        {
            var messages = new List <ItemChange <Person> >();

            var messageWriter = _source.Connect().ForEachItemChange(messages.Add).Subscribe();

            _source.AddRange(new RandomPersonGenerator().Take(5));
            _source.InsertRange(new RandomPersonGenerator().Take(5), 2);
            _source.AddRange(new RandomPersonGenerator().Take(5));

            messages.Count.Should().Be(15);
            messageWriter.Dispose();
        }