コード例 #1
0
        public void FirstTenGeneratedNumbersShouldBePrimes()
        {
            var expected = new List <int> {
                2, 3, 5, 7, 11, 13, 17, 19, 23, 29
            };
            var actual = PrimeGenerator.GenerateFirst(10).ToArray();

            var i = 0;

            expected.ForEach((number) => {
                Assert.AreEqual(number, actual[i]);
                i++;
            });
        }
コード例 #2
0
        public void GenerateFirstShouldReturnCollectionWithRightLength()
        {
            var primes = PrimeGenerator.GenerateFirst(10).ToArray();

            Assert.AreEqual(primes.Length, 10);
        }