Ejemplo n.º 1
0
        public void ShouldProvideSameSequences()
        {
            NaturalNumbers nats  = new NaturalNumbers();
            int            input = 10;

            int[] sequenceWithLength = nats.GetSequence(input);
            int[] sequenceNoLength   = nats.GetSequence();
            CollectionAssert.AreEqual(sequenceNoLength, sequenceWithLength);
        }
Ejemplo n.º 2
0
        public void ShouldPrintSequenceOfNumbers()
        {
            NaturalNumbers nats = new NaturalNumbers();

            int[] expected = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            int[] actual   = nats.GetSequence();
            CollectionAssert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void PrintSequenceofNumbers()
        {
            NaturalNumbers nats     = new NaturalNumbers();
            int            length   = 7;
            string         expected = "1 2 3 4 5 6 7";
            string         actual   = nats.ToString(nats.GetSequence(length));

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void ShouldPrintAVariableSequenceOfNumbers()
        {
            NaturalNumbers nats  = new NaturalNumbers();
            int            input = 8;

            int[] expected = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            int[] actual   = nats.GetSequence(input);
            CollectionAssert.AreEqual(expected, actual);
        }