public void ConvertToArrayLocationTestLow()
        {
            TicTac t = new TicTac();
            int[] expected = new int[] { 0, 1 };

            int[] actual = t.ConvertToArrayLocation("2");

            CollectionAssert.AreEqual(expected, actual);
        }
        public void ConvertToArrayLocationTestOutOfBounds()
        {
            //What should happen when the user enters an invalid number (out of bounds of the map)?
            TicTac t = new TicTac();
            int[] expected = new int[] { 2, 2 };

            int[] actual = t.ConvertToArrayLocation("15");

            CollectionAssert.AreEqual(expected, actual);
        }
        public void ConvertToArrayLocationTestNonInt()
        {
            //This test is here to show you invalid input is not handled
            TicTac t = new TicTac();
            int[] expected = new int[] { 2, 2 };

            int[] actual = t.ConvertToArrayLocation("a");

            CollectionAssert.AreEqual(expected, actual);
        }
Пример #4
0
        public void ConvertToArrayLocationTestOutOfBounds()
        {
            //What should happen when the user enters an invalid number (out of bounds of the map)?
            TicTac t = new TicTac();
            int[] expected = new int[] { 2, 2 };

            try
            {
                int[] actual = t.ConvertToArrayLocation("15");
            }
            catch (IndexOutOfRangeException e)
            {
                Assert.IsInstanceOfType(e, typeof(IndexOutOfRangeException));
            }
        }
Пример #5
0
        public void ConvertToArrayLocationTestNonInt()
        {
            //This test is here to show you invalid input is not handled
            TicTac t = new TicTac();
            int[] expected = new int[] { 2, 2 };

            try
            {
                int[] actual = t.ConvertToArrayLocation("a");
            }
            catch (FormatException e)
            {
               Assert.IsInstanceOfType(e, typeof(FormatException));
            }
        }