public void initCellsTest() { int num = 5; Map_Accessor map = new Map_Accessor(new []{10, 10}); Position_Accessor[] actual; actual = Lifegame_Accessor.initCells(num, map); CollectionAssert.AllItemsAreUnique(actual); Assert.IsTrue( actual.All( pos => (from index in Enumerable.Range(0, map.Size.Length) select index) .All(index => Enumerable.Range(0, map.Size[index]).Contains(pos.Coordinates[index])))); }
public void initCellsTest() { int num = 5; Map_Accessor map = new Map_Accessor(new [] { 10, 10 }); Position_Accessor[] actual; actual = Lifegame_Accessor.initCells(num, map); CollectionAssert.AllItemsAreUnique(actual); Assert.IsTrue( actual.All( pos => (from index in Enumerable.Range(0, map.Size.Length) select index) .All(index => Enumerable.Range(0, map.Size[index]).Contains(pos.Coordinates[index])))); }