Exemplo n.º 1
0
        public void RetrieveCell_NonExisting_NullIsReturned()
        {
            var universe = new Universe();
            var position = Point.Empty;

            Assert.AreEqual(null, universe.GetCellAtPosition(position));
        }
Exemplo n.º 2
0
        public void RetrieveCell_Existing_CorrectCellIsReturned()
        {
            var universe = new Universe();

            var position = Point.Empty;
            var cell = new Cell(position, true);
            universe.AddCell(cell);

            Assert.AreEqual(cell, universe.GetCellAtPosition(position));
        }
Exemplo n.º 3
0
        public void AddCell_Existing_AddsNewCell()
        {
            var universe = new Universe();

            var position = Point.Empty;
            var firstCell = new Cell(position, true);
            var secondCell = new Cell(position, true);

            universe.AddCell(firstCell);
            universe.AddCell(secondCell);

            Assert.AreEqual(secondCell, universe.GetCellAtPosition(position));
        }