Exemplo n.º 1
0
        public void CheckRhombus()
        {
            int[,] matrix = new int[5, 5] {
                { 0, 1, 0, 0, 0 }, { 1, 0, 1, 0, 0 }, { 1, 0, 1, 0, 0 }, { 0, 1, 0, 0, 0 }, { 0, 0, 0, 0, 0 }
            };
            LifeAlgoritm LA = new LifeAlgoritm(matrix);

            Assert.AreEqual(matrix, LA.Matrix);
        }
Exemplo n.º 2
0
        public void CheckSomeField()
        {
            int[,] startMatrix = new int[5, 5] {
                { 1, 1, 0, 0, 0 }, { 0, 1, 0, 1, 1 }, { 1, 0, 0, 0, 0 }, { 0, 0, 1, 0, 0 }, { 0, 1, 0, 0, 1 }
            };
            LifeAlgoritm LA = new LifeAlgoritm(startMatrix);

            int[,] finishMatrix = new int[5, 5] {
                { 1, 1, 1, 0, 0 }, { 0, 1, 1, 0, 0 }, { 0, 1, 1, 1, 0 }, { 0, 1, 0, 0, 0 }, { 0, 0, 0, 0, 0 }
            };
            Assert.AreEqual(finishMatrix, LA.Matrix);
        }
Exemplo n.º 3
0
        public void CheckThreeElementsLine()
        {
            int[,] startMatrix = new int[5, 5] {
                { 0, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0 }, { 0, 1, 0, 0, 0 }, { 0, 1, 0, 0, 0 }, { 0, 0, 0, 0, 0 }
            };
            LifeAlgoritm LA = new LifeAlgoritm(startMatrix);

            int[,] finishMatrix = new int[5, 5] {
                { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, { 1, 1, 1, 0, 0 }, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }
            };
            Assert.AreEqual(finishMatrix, LA.Matrix);
        }