コード例 #1
0
        public void Universe_SetInitialState_ValidStringWith4Cells_CellCountIs4()
        {
            var universe = new Universe();
            universe.SetInitialState(".OOO");

            Assert.IsTrue(universe.Cells.Count == 4);
        }
コード例 #2
0
        public void Universe_SetInitialState_OneDeadCell_CellCountIs1()
        {
            var universe = new Universe();
            universe.SetInitialState(".");

            Assert.IsTrue(universe.Cells.Count == 1);
        }
コード例 #3
0
        public void Universe_SetInitialState_StringContainsInvalidChars_CellCountIs0()
        {
            var universe = new Universe();
            universe.SetInitialState(".x.");

            Assert.IsTrue(universe.Cells.Count == 0);
        }
コード例 #4
0
        public void Universe_SetInitialState_NullString_CellsCountIs0()
        {
            var universe = new Universe();
            universe.SetInitialState(null);

            Assert.IsTrue(universe.Cells.Count == 0);
        }