コード例 #1
0
        public void Get_computer_image()
        {
            ComputersController computersController = new ComputersController();
            string computerName = "iMac 27";

            string [] expectedResult =
            {
                "                                                        ",
                "  *      *    *                           ****   ****** ",
                "         **  **   ***     ***            *    *       * ",
                " **      * ** *      *   *                    *      *  ",
                "  *      *    *   ****   *                ****      *   ",
                "  *      *    *  *   *   *               *         *    ",
                " ***     *    *   ****    ***            ******    *    ",
                "                                                        "
            };
            ComputerInfoDto computerInfo = computersController.FindComputerByName(computerName);

            ComputerImageInfoDto imageInfo = computersController.GetComputerImage(computerInfo.Id);

            imageInfo.Content.ForEach(Console.WriteLine);
            Assert.AreEqual(expectedResult, imageInfo.Content);
        }
コード例 #2
0
        public void Raise_an_error_when_searching_image_info_of_non_existing_computer()
        {
            ComputersController computersController = new ComputersController();
            Exception           exception           = Assert.Throws <Exception>(() => computersController.GetComputerImage("unknown_guid"));

            Assert.AreEqual("Computer not found, guid: unknown_guid", exception.Message);
        }