public void Must_ReturnAnInstanceThatWrapsTheSuppliedIEnumerable( IEnumerable <object> source) { var snumerable = Smartnumerable.Create(source); AssertionExtensions.SequencesAreEqual(source, snumerable); }
public void Must_CreateAnInstanceOfSmartnumerableType( IEnumerable <string> source) { var snumerable = Smartnumerable.Create(source); Assert.IsAssignableFrom <Smartnumerable <object> >(snumerable); }
public void GetEnumerator_Must_ReturnTheProvidedEnumerator() { var snumerator = new Smartnumerator <string>( new Mock <IEnumerator <string> >().Object); target = new Smartnumerable <string>(snumerator); var enumerator = target.GetEnumerator(); Assert.AreEqual(snumerator, enumerator); }
public void GetEnumerator_SubsequentInvocations_Must_ReturnTheSameProvidedEnumerator( int subsequentInvocationCount) { var snumerator = new Smartnumerator <string>( new Mock <IEnumerator <string> >().Object); target = new Smartnumerable <string>(snumerator); target.GetEnumerator(); for (int i = 2; i < subsequentInvocationCount + 2; i++) { Assert.AreEqual(snumerator, target.GetEnumerator(), $"invocation #{i}"); } }