public void UnboundedWorldEnsureCorrectNumberOfAliveNeighbors() { /* Begin Arrange */ UnboundedWorld my_world = new UnboundedWorld(); /* End Arrange */ /* Begin Act */ my_world.AddCell(4, 4); my_world.AddCell(4, 5); my_world.AddCell(4, 3); List<Cell> expected_alive_neighbors = new List<Cell> { new Cell { X = 4,Y=5}, new Cell { X = 4,Y=3} }; List<Cell> actual_alive_neighbors = my_world.AliveNeighbors(4, 4); int expected_alive_neighbors_count = 2; int actual_alive_neighbors_count = actual_alive_neighbors.Count; /* End Act */ /* Begin Assert */ //Assert.IsTrue(actual_alive_neighbors[0].Equals(new Cell { X = 4, Y = 5 })); //CollectionAssert.AreEqual(expected_alive_neighbors, actual_alive_neighbors); Assert.AreEqual(expected_alive_neighbors_count, actual_alive_neighbors_count); /* End Assert */ }
public void UnboundedEnsureThereAreCells() { UnboundedWorld instance = new UnboundedWorld(); int x = 4; int y = 3; instance.AddCell(x,y); Assert.AreEqual(1, instance.CellCount()); }
public void UnboundedWorldEnsureThereAreCells() { // Arrange UnboundedWorld my_world = new UnboundedWorld(); // Act int x = 4; int y = 3; my_world.AddCell(x,y); // Assert Assert.AreEqual(1, my_world.CellCount()); }
public void UnboundedEnsureCorrectNumberOfAliveNeighbors() { UnboundedWorld instance = new UnboundedWorld(); instance.AddCell(4, 4); instance.AddCell(4, 5); instance.AddCell(4, 3); List<Cell> expected_alive_neighbors = new List<Cell> { new Cell {X = 4, Y = 5 }, new Cell {X = 4, Y = 3 } }; List<Cell> actual_alive_neighbors = instance.AliveNeighbors(4,4); int expected_alive_neighbors_count = 2; int actual_alive_neighbors_count = actual_alive_neighbors.Count; //Assert.IsTrue(actual_alive_neighbors[0].Equals(new Cell { X = 4, Y = 5 })); //CollectionAssert.AreEqual(expected_alive_neighbors, actual_alive_neighbors); Assert.AreEqual(expected_alive_neighbors_count, actual_alive_neighbors_count); }
public void UnboundedWorldEnsureThereAreCells() { /* Begin Arrange */ UnboundedWorld my_world = new UnboundedWorld(); /* End Arrange */ /* Begin Act */ int x = 4; int y = 3; my_world.AddCell(x,y); /* End Act */ /* Begin Assert */ Assert.AreEqual(1, my_world.CellCount()); /* End Assert */ }