static void Main(string[] args) { Centralita cen = new Centralita("Nico"); Local asd = new Local("Pehua", 12, "asd", 12); Provincial dsa = new Provincial("asdsad", Franja.Franja_1, 231, "asdas"); try { cen += asd; cen += dsa; cen += asd; } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadKey(); }
public void TestLlamadasComparacion() { Local local = new Local("111", 20, "222", 400); Local local2 = new Local("111", 4330, "222", 300); Provincial provincial = new Provincial("111", Provincial.Franja.Franja_1, 544, "222"); Provincial provincial2 = new Provincial("111", Provincial.Franja.Franja_2, 478, "222"); Assert.IsTrue(local == local2); Assert.IsFalse(local == provincial); Assert.IsFalse(local == provincial2); Assert.IsTrue(local2 == local); Assert.IsFalse(local2 == provincial); Assert.IsFalse(local2 == provincial2); Assert.IsFalse(provincial == local); Assert.IsFalse(provincial == local2); Assert.IsTrue(provincial == provincial2); Assert.IsFalse(provincial2 == local); Assert.IsFalse(provincial2 == local2); Assert.IsTrue(provincial2 == provincial); }