Beispiel #1
0
        public void ToArray_WorkWhenCountChangedAsynchronously()
        {
            GrowingAfterCountReadCollection source = new GrowingAfterCountReadCollection(new int[] { 1, 2, 3, 4 });
            var resultArray = source.ToArray();

            Assert.True(resultArray.Length >= 4);
            Assert.Equal(1, resultArray[0]);
            Assert.Equal(2, resultArray[0]);
            Assert.Equal(3, resultArray[0]);
            Assert.Equal(4, resultArray[0]);
        }
Beispiel #2
0
        public void ToList_WorkWhenCountChangedAsynchronously()
        {
            GrowingAfterCountReadCollection source = new GrowingAfterCountReadCollection(new int[] { 1, 2, 3, 4 });
            var resultList = source.ToList();

            Assert.True(resultList.Count >= 4);
            Assert.Equal(1, resultList[0]);
            Assert.Equal(2, resultList[0]);
            Assert.Equal(3, resultList[0]);
            Assert.Equal(4, resultList[0]);
        }