Exemple #1
0
        public void EmptyTest()
        {
            Rack rack = new Rack();

            int[] emptyArray     = rack.DrawNoBalls();
            int[] expectedOutput = new int[] { };

            CollectionAssert.AreEqual(emptyArray, expectedOutput);
        }
Exemple #2
0
        public void KeepAddingBalls()
        {
            Rack rack = new Rack();

            int[] rackArray      = rack.DrawNoBalls();
            int[] expectedOutput = new int[] { };
            CollectionAssert.AreEqual(rackArray, expectedOutput);
            // Should return array of no size

            rackArray[0]   = rack.AddBall(0);
            expectedOutput = new int[] { 0 };
            CollectionAssert.AreEqual(rackArray, expectedOutput);


            rackArray[1]   = rack.AddBall(1);
            expectedOutput = new int[] { 0, 1 };
            CollectionAssert.AreEqual(rackArray, expectedOutput);
        }