Exemple #1
0
 public void TestImmutability()
 {
     var wheelElement = new WheelElement(2);
     long oldValue = wheelElement.Number;
     wheelElement.Next();
     Assert.AreEqual(oldValue, wheelElement.Number);
 }
Exemple #2
0
 public void TestFirst4Primes()
 {
     const int Count = 10000;
     var expected = Enumerable.Range(2, Count).Where(ShouldBeInWheelForFirst4Primes);
     var actual = new List<long>();
     var wheelElement = new WheelElement(4);
     while (wheelElement.Number <= Count + 1)
     {
         actual.Add(wheelElement.Number);
         wheelElement = wheelElement.Next();
     }
     CollectionAssert.AreEqual(expected.ToList(), actual);
 }