public void TestCase2()
 {
     int[,] field = new int[10, 10]
     {
         { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0 },
         { 1, 0, 1, 0, 0, 0, 0, 0, 1, 0 },
         { 1, 0, 1, 0, 1, 1, 1, 0, 1, 0 },
         { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
         { 0, 1, 0, 0, 0, 0, 0, 0, 1, 0 },
         { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0 },
         { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
         { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
         { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
         { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
     };
     Assert.IsFalse(BattleshipField.ValidateBattlefield(field));
 }
Esempio n. 2
0
        public void TestCase()
        {
            var field = new int[10, 10]
            {
                { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0 },
                { 1, 0, 1, 0, 0, 0, 0, 0, 1, 0 },
                { 1, 0, 1, 0, 1, 1, 1, 0, 1, 0 },
                { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
                { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
                { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
            };

            Assert.IsTrue(BattleshipField.ValidateBattlefield(field));
        }