Пример #1
0
        public void i_get_the_help_text()
        {
            using (var gameObjects = new GameObjects())
            {
                //prepare
                var expectedMessage = "You feel your sanity returning to you. You quickly " +
                                      "find your way out of the cave and get back to your life as a farmer.";

                var commandOutput = Command.Get(gameObjects, "quit");

                //assert
                Assert.Equal(expectedMessage, CleanText.Run(commandOutput.Output));
            }
        }
Пример #2
0
        public void i_get_the_help_text()
        {
            using (var gameObjects = new GameObjects())
            {
                //prepare
                var expectedMessage = "Commands: search, status, pickup <item>, drop <item>, help, quit";

                //execute
                var commandOutput = Command.Get(gameObjects, "help");

                //assert
                Assert.Equal(expectedMessage, CleanText.Run(commandOutput.Output));
            }
        }
Пример #3
0
        public void i_get_the_location_weapon_and_inventory_items()
        {
            using (var gameObjects = new GameObjects())
            {
                //prepare
                var expectedMessage = "You are in the EntranceThis is the entrance of the cave." +
                                      "You entered from the door to the south. There is an entrance to the north" +
                                      "You have no weapon equippedYou have nothing in your inventory";

                //execute
                var commandOutput = Command.Get(gameObjects, "status");

                //assert
                Assert.Equal(expectedMessage, CleanText.Run(commandOutput.Output));
            }
        }
Пример #4
0
        public void i_get_the_items_back()
        {
            using (var gameObjects = new GameObjects())
            {
                //prepare
                var expectedMessage = "After searching the room you find:potion, rusty sword";

                gameObjects.Player.GetCurrentRoom().RemoveAllItems();
                gameObjects.Player.GetCurrentRoom().AddItem(new Potion());
                gameObjects.Player.GetCurrentRoom().AddItem(new RustySword());

                //execute
                var commandOutput = Command.Get(gameObjects, "search");

                //assert
                Assert.Equal(expectedMessage, CleanText.Run(commandOutput.Output));
            }
        }
Пример #5
0
        public void i_get_the_location_weapon_and_inventory_items()
        {
            using (var gameObjects = new GameObjects())
            {
                //prepare
                var expectedMessage = "You are in the EntranceThis is the entrance of the cave." +
                                      "You entered from the door to the south. There is an entrance to the north" +
                                      "You have a rusty sword equippedYou carry in your inventory:potion";

                gameObjects.Player.EquipWeapon <RustySword>();
                gameObjects.Player.PickupItem <Potion>();

                //execute
                var commandOutput = Command.Get(gameObjects, "status");

                //assert
                Assert.Equal(expectedMessage, CleanText.Run(commandOutput.Output));
            }
        }