コード例 #1
0
        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]))));
        }
コード例 #2
0
        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]))));
        }