예제 #1
0
        public async Task ShouldNotWalkHorizontallyInToWalls()
        {
            var wallLocation       = _gameSettings.PacMan.Location.Right;
            var ghostStartLocation = _gameSettings.PacMan.Location.Right.Right;

            _gameSettings.Walls.Add(wallLocation);
            var ghost = _ghostBuilder.WithLocation(ghostStartLocation).Create();

            _gameSettings.Ghosts.Add(ghost);

            var gameHarness = new GameHarness(_gameSettings);

            gameHarness.StartGame();
            await gameHarness.Move();

            using var _ = new AssertionScope();
            gameHarness.Game.Ghosts[ghost.Name].Should().NotBeEquivalentTo(new
            {
                Location = wallLocation
            });

            gameHarness.Game.Ghosts[ghost.Name].Should().NotBeEquivalentTo(new
            {
                Location = ghostStartLocation
            });
        }