Ejemplo n.º 1
0
        public void Constructor_WhenInvoked_PreparesAcornCorrectly()
        {
            // act
            var acorn = new Acorn();

            int oneSide = acorn.GetPattern().Length;
            int otherSide = acorn.GetPattern().Max(x => x.Length);

            // assert
            Assert.IsTrue(
                oneSide == 8 && oneSide == otherSide,
                message: "The acorn pattern was not of size 8x8.");

            Assert.IsTrue(
                acorn.IsStable,
                message: "The acorn pattern was not stable.");

            Assert.AreEqual(
                expected: 5206,
                actual: acorn.StabilizesAt,
                message: "The acorn pattern stabilizes at the wrong time.");

            Assert.AreEqual(
                expected: 633,
                actual: acorn.StablePopulation,
                message: "The acorn pattern has wrong number of cells in the stable population.");
        }