public void TestSharesEnumerator() { Shares <BigInteger> shares = TestData.GetPredefinedShares(); var testDataSequence = TestData.GetPredefinedShares().Select(entry => new FinitePoint <BigInteger>(entry)); var testDataArray = testDataSequence as FinitePoint <BigInteger>[] ?? testDataSequence.ToArray(); var actual = ((IEnumerable)shares).GetEnumerator(); var expected = testDataArray.GetEnumerator(); for (var i = 0; i < testDataArray.Length; i++) { Assert.Equal(expected.MoveNext(), actual.MoveNext()); Assert.Equal(expected.Current, actual.Current); } Assert.True(shares.SequenceEqual(testDataArray)); }