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 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()); }
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()); }