Пример #1
0
        private void InitializeMaze(IAxisFactory axisFactory, IMazeViewDataFactory mazeViewDataFactory)
        {
            IMazeNodeData nodeData = _mazeNodeDataBuilder.GenerateNodeData(12345);
            IMazeViewData viewData = _mazeNodeDataBuilder.GenerateViewData(nodeData, axisFactory, mazeViewDataFactory);

            _maze.Initialize(nodeData, viewData);
        }
Пример #2
0
        public void GenerateNodeDataTest()
        {
            var           settings    = new DefaultSettings();
            var           nodeBuilder = new NodeBuilder(settings, new CoinBuilder(settings));
            var           mazeNodeDataBuilderbuilder = new MazeNodeDataBuilder(new FakeMazeNodeDataBuilderSettings(5, 3), new Randomizer(), nodeBuilder);
            IMazeNodeData data = mazeNodeDataBuilderbuilder.GenerateNodeData(12345);

            Assert.NotNull(data);
        }
Пример #3
0
        public void InitializeTest()
        {
            IAxisFactory         axisFactory         = new AxisFactory();
            IMazeViewDataFactory mazeViewDataFactory = new MazeViewDataFactory();
            var           settings        = new DefaultSettings();
            var           nodeBuilder     = new NodeBuilder(settings, new CoinBuilder(settings));
            var           randomizer      = new Randomizer();
            var           nodeDataBuilder = new MazeNodeDataBuilder(new FakeMazeNodeDataBuilderSettings(3, 3), randomizer, nodeBuilder);
            IMazeNodeData nodeData        = nodeDataBuilder.GenerateNodeData(12345);
            IMazeViewData viewData        = nodeDataBuilder.GenerateViewData(nodeData, axisFactory, mazeViewDataFactory);
            var           maze            = new Maze(new UnitList(), new UnitFactory(randomizer));

            maze.Initialize(nodeData, viewData);

            int numberOfNodesTotal = maze.NodeData.Count;
            int numberOfNodesView  = maze.ViewData.MazeNodes.Count;
            int numberOfUnits      = maze.UnitList.Count;

            Assert.Equal(1, numberOfUnits);
            Assert.Equal(9, numberOfNodesView);
            Assert.Equal(27, numberOfNodesTotal);
        }