public void DeadCellWith3NeighboursLives()
        {
            Field field = new Field(3, 3);
            field.SetCell(0, 0);    //Neighbour
            field.SetCell(1, 0);    //Neighbour
            field.SetCell(2, 0);    //Neighbour

            field.Update();

            Assert.IsTrue(field.GetCell(1, 1));
        }
        public void CellWithEnoughNeighboursLives()
        {
            Field field = new Field(3, 3);
            field.SetCell(1, 1);    //Test cell
            field.SetCell(0, 0);    //Neighbour
            field.SetCell(1, 0);    //Neighbour

            field.Update();

            Assert.IsTrue(field.GetCell(1, 1));
        }
        public void FieldCanHaveCellSet()
        {
            Field field = new Field(1, 1);
            field.SetCell(0, 0);

            Assert.IsTrue(field.GetCell(0, 0));
        }
        public GOLRenderer()
        {
            mField = new Field(192, 108);

            Random rand = new Random((int)DateTime.Now.Ticks);

            for (int x = 0; x < mField.Width; ++x)
            {
                for (int y = 0; y < mField.Height; ++y)
                {
                    if (rand.NextDouble() > 0.5)
                    {
                        mField.SetCell((uint)x, (uint)y);
                    }
                }
            }

            mBmp = new Bitmap(1920, 1080);
        }
        public void OvercrowdedCellDies()
        {
            Field field = new Field(3, 3);
            field.SetCell(1, 1);    //Test cell
            field.SetCell(0, 0);    //Neighbour
            field.SetCell(1, 0);    //Neighbour
            field.SetCell(2, 0);    //Neighbour
            field.SetCell(0, 1);    //Neighbour

            field.Update();

            Assert.IsFalse(field.GetCell(1, 1));
        }
        public void LonelyCellDies()
        {
            Field field = new Field(3, 3);
            field.SetCell(1, 1);

            field.Update();

            Assert.IsFalse(field.GetCell(1, 1));
        }