Example #1
0
        public void InitializeTest_IncorrectInputForTwoArguments_ExpectedException(int startValue, int boundaryValue)
        {
            //Arrange
            SquareLessNSequenceGenerator fb = new SquareLessNSequenceGenerator();

            //Act
            fb.Initialize(startValue, boundaryValue);
        }
Example #2
0
        public void GetEnumeratorTest_CorrectInputForTwoArgument(int boundaryValue, int startValue, int[] expected)
        {
            //Arrange
            SquareLessNSequenceGenerator fb = new SquareLessNSequenceGenerator();

            fb.Initialize(startValue, boundaryValue);
            int[] actual = new int[0];

            //Act
            int i = 0;

            foreach (int element in fb)
            {
                Console.WriteLine(element);
                Array.Resize <int>(ref actual, i + 1);
                actual[i] = element;
                i++;
            }

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }