Exemplo n.º 1
0
        public void WhenDestinationReachedEventShouldCalled()
        {
            string sequenceOfCommands = "ssdddww";
            var    game = new GameClassForTest(_pathToCorrectMap, new CommandsEventLoop(sequenceOfCommands));
            bool   flag = false;

            game.GetPlayer().DestinationReached += (object sender, EventArgs args) => flag = true;
            game.Start();

            Assert.IsTrue(flag);
        }
Exemplo n.º 2
0
        public void PlayerMovementsTest(string sequenceOfCommands, int expectedX, int expectedY)
        {
            var game = new GameClassForTest(_pathToCorrectMap, new CommandsEventLoop(sequenceOfCommands));

            game.Start();

            var expected = new Coordinates(expectedX, expectedY);
            var actual   = game.GetPlayer().CurrentCoordinates;

            // AreEqual требует перегрузки ==, но с этим как-то не задалось(
            Assert.IsTrue(actual.Equals(expected));
        }