public void Ignores_NullInstances()
        {
            // Arrange
            var declaredEnumerableOfT = typeof(IEnumerable<int>);
            var wrapperProvider = new EnumerableWrapperProvider(
                                        declaredEnumerableOfT,
                                        elementWrapperProvider: null);

            // Act
            var wrapped = wrapperProvider.Wrap(null);

            // Assert
            Assert.Equal(typeof(DelegatingEnumerable<int, int>), wrapperProvider.WrappingType);
            Assert.Null(wrapped);
        }
Ejemplo n.º 2
0
        public void Ignores_NullInstances()
        {
            // Arrange
            var declaredEnumerableOfT = typeof(IEnumerable <int>);
            var wrapperProvider       = new EnumerableWrapperProvider(
                declaredEnumerableOfT,
                elementWrapperProvider: null);

            // Act
            var wrapped = wrapperProvider.Wrap(null);

            // Assert
            Assert.Equal(typeof(DelegatingEnumerable <int, int>), wrapperProvider.WrappingType);
            Assert.Null(wrapped);
        }
        public void Wraps_EmptyCollections()
        {
            // Arrange
            var declaredEnumerableOfT = typeof(IEnumerable<int>);
            var wrapperProvider = new EnumerableWrapperProvider(
                                                declaredEnumerableOfT,
                                                elementWrapperProvider: null);

            // Act
            var wrapped = wrapperProvider.Wrap(new int[] { });

            // Assert
            Assert.Equal(typeof(DelegatingEnumerable<int, int>), wrapperProvider.WrappingType);
            Assert.NotNull(wrapped);
            var delegatingEnumerable = wrapped as DelegatingEnumerable<int, int>;
            Assert.NotNull(delegatingEnumerable);
            Assert.Equal(0, delegatingEnumerable.Count());
        }
Ejemplo n.º 4
0
        public void Wraps_EmptyCollections()
        {
            // Arrange
            var declaredEnumerableOfT = typeof(IEnumerable <int>);
            var wrapperProvider       = new EnumerableWrapperProvider(
                declaredEnumerableOfT,
                elementWrapperProvider: null);

            // Act
            var wrapped = wrapperProvider.Wrap(new int[] { });

            // Assert
            Assert.Equal(typeof(DelegatingEnumerable <int, int>), wrapperProvider.WrappingType);
            Assert.NotNull(wrapped);
            var delegatingEnumerable = wrapped as DelegatingEnumerable <int, int>;

            Assert.NotNull(delegatingEnumerable);
            Assert.Equal(0, delegatingEnumerable.Count());
        }