Exemple #1
0
        public void neighboursCounter3Test() //testujemy warunek brzegowy malej tablicy - pole jest na skraju tablicy
        {
            OneFieldInMapForLifeGame a = new OneFieldInMapForLifeGame();

            int[,] tab = new int[, ] {
                { 1, 1 }, { 0, 0 }
            };
            int countN1 = a.NeighboursCounter(tab, 0, 1);

            Assert.AreEqual(countN1, 2);
        }
Exemple #2
0
        public void neighboursCounterTest()  //testujemy zwykły warunek - pole jest w środku tablicy
        {
            OneFieldInMapForLifeGame a = new OneFieldInMapForLifeGame();

            int[,] tab = new int[, ] {
                { 0, 1, 0, 1 }, { 1, 0, 0, 1 }, { 1, 1, 0, 0 }, { 0, 1, 0, 0 }
            };
            int countN1 = a.NeighboursCounter(tab, 1, 2);

            Assert.AreEqual(countN1, 4);
        }