static void TestProductEqualsWithInheritance() { // these 2 objects should be equal. They reference the same object. //Product p1 = new Product(1, "T100", "This is a test product", 100M, 10); //Product p2 = new Product(1, "T100", "This is a test product", 100M, 10); Clothing c1 = new Clothing(3, "C100", "Running tights", 69.99M, 3, "pants", "womens", "large", "blue", "Lucy"); Clothing c2 = new Clothing(3, "C100", "Running tights", 69.99M, 3, "pants", "womens", "large", "blue", "Lucy"); Clothing c3 = new Clothing(1, "T100", "This is a test product", 100M, 10, "not pants", "womens", "large", "blue", "Lucy"); Gear g1 = new Gear(5, "G100", "Sky 10 Kayak", 1049M, 2, "paddle", "Eddyline", "plastic laminate", 32); Gear g2 = new Gear(5, "G100", "Sky 10 Kayak", 1049M, 2, "paddle", "Eddyline", "plastic laminate", 32); Gear g3 = new Gear(1, "T100", "This is a test product", 100M, 10, "paddle", "Eddyline", "plastic laminate", 32); Console.WriteLine("Testing product equals."); //Console.WriteLine("2 products that have the same properties should be equal. Expecting true. " + p1.Equals(p2)); Console.WriteLine("2 clothing that have the same properties should be equal. Expecting true. " + c1.Equals(c2)); Console.WriteLine("2 gear that have the same properties should be equal. Expecting true. " + g1.Equals(g2)); Console.WriteLine("Clothing and Gear should not be equal. Expecting false. " + c3.Equals(g3)); Console.WriteLine("Testing product ==."); //Console.WriteLine("2 products that have the same properties should be equal. Expecting true. " + (p1 == p2)); Console.WriteLine("2 clothing that have the same properties should be equal. Expecting true. " + (c1 == c2)); Console.WriteLine("2 gear that have the same properties should be equal. Expecting true. " + (g1 == g2)); Console.WriteLine("Clothing and Gear should not be equal. Expecting false. " + (c3 == g3)); Console.WriteLine("2 clothing that have the same product attributes should not be equal. Expecting false. " + (c1 == c3)); Console.WriteLine(); }