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); }
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); }