public void ShowRealtyData() { try { Console.WriteLine("Write realty's index:"); int index = Convert.ToInt32(Console.ReadLine()); if (realtyManagement.ShowRealtyInfo(index) == null) { Console.WriteLine("Index out of range!"); throw new IndexOutOfRangeException(); } Console.WriteLine(realtyManagement.ShowRealtyInfo(index)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void ShowRealtyInfo_shouldReturn_Realty() { string showRealty; string realty; CreateRealties(); showRealty = realtyManagement.ShowRealtyInfo(0); realty = realty1.ToString(); Assert.AreEqual(realty, showRealty); }