public void When_IsNullOrEmpty_is_called_with_a_empty_ICollection_as_IEnumerable()
        {
            // Arrange.
            IEnumerable <object> objects = new WeirdClassThatImplementsGenericIEnumerableButNonGenericICollection();

            // Act.
            bool result = objects.IsNullOrEmpty();

            // Assert.
            result.Should().BeTrue();
        }
Example #2
0
        public void When_IsNotEmpty_is_called_with_a_empty_ICollection_as_IEnumerable()
        {
            // Arrange.
            IEnumerable <object> objects = new WeirdClassThatImplementsGenericIEnumerableButNonGenericICollection();

            // Act.
            Action action = () =>
                            Ensure.Arg(objects).IsNotNullOrEmpty();

            // Assert.
            action.ShouldThrow <ArgumentException>();
        }