示例#1
0
        public void CollectionCanBeConstructedFromEnumerable()
        {
            // Arrange
            var enumerable = Enumerable.Range(0, 5);

            // Act
            var collection = new SmartCollection <int>(enumerable);

            // Assert
            CollectionAssert.AreEqual(enumerable.ToArray(), collection.ToArray());
        }
示例#2
0
        public void CollectionCanBeConstructedFromList()
        {
            // Arrange
            var list = new List <int> {
                3, 6, 3, 2
            };

            // Act
            var collection = new SmartCollection <int>(list);

            // Assert
            CollectionAssert.AreEqual(list.ToArray(), collection.ToArray());
        }
示例#3
0
        public void ResetReplacesContent()
        {
            // Arrange
            var collection = new SmartCollection <int>
            {
                1, 2, 3
            };

            // Act
            collection.Reset(new[] { 4, 5, 6 });

            // Assert
            CollectionAssert.AreEqual(new[] { 4, 5, 6 }, collection.ToArray());
        }