public void CountEquals_IEnumerable_ResetWasCall()
        {
            var enumerable = EnumerableMock.CreateWintCountElems(1);

            EnumerableExtension.CountEquals(enumerable, 1);
            Assert.True(enumerable.ResetWasCall);
        }
        public void CountEquals_IEnumerableManyElems_NoUnnecessaryIterations()
        {
            EnumerableMock enumerable = EnumerableMock.CreateWintCountElems(100);

            EnumerableExtension.CountEquals(enumerable, 2);
            Assert.Equal(3, enumerable.MoveNextCallCounter);
        }
 public void CountEquals_IEnumerableCountIsEquals_True()
 {
     Assert.True(EnumerableExtension.CountEquals(EnumerableMock.CreateWintCountElems(2), 2));
 }
 public void CountEquals_IEnumerableCountIsMore_False()
 {
     Assert.False(EnumerableExtension.CountEquals(EnumerableMock.CreateWintCountElems(2), 1));
 }
 public void CountEquals_IEnumerableCountIsLess_False()
 {
     Assert.False(EnumerableExtension.CountEquals(EnumerableMock.CreateEmpty(), 1));
 }
 public void CountEquals_ICollectionCountIsEquals_True()
 {
     Assert.True(EnumerableExtension.CountEquals(
                     enumerable: new OnlyCountCollectionMock(count: 3),
                     count: 3));
 }
 public void CountEquals_ICollectionCountNotEquals_False()
 {
     Assert.False(EnumerableExtension.CountEquals(
                      enumerable: new OnlyCountCollectionMock(count: 3),
                      count: 1));
 }