コード例 #1
0
ファイル: QuitTests.cs プロジェクト: jimkits/DungeonText
        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
ファイル: StatusTests.cs プロジェクト: jimkits/DungeonText
        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
ファイル: StatusTests.cs プロジェクト: jimkits/DungeonText
        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));
            }
        }