Beispiel #1
0
        public void FirstOrNull_ShouldEnumerateOnce()
        {
            // arrange
            var data = new TestEnumerable <int> (new[] { 1, 2, 3 });


            // act
            var result = data.Enumerate().FirstOrNull();


            // assert
            result.Should().Be(1);
            data.EnumeratedCount.Should().Be(1);
        }
Beispiel #2
0
        public void IsNullOrEmpty_ShouldEnumerateOnce()
        {
            // arrange
            var data = new TestEnumerable <string> (new[] { "a", "b", "c" });


            // act
            var result = data.Enumerate().IsNullOrEmpty();


            // assert
            result.Should().BeFalse();
            data.EnumeratedCount.Should().Be(1);
        }