public static void testMultipleMethodCall() { Klass obj = new Klass(); obj.multipleMethodCall(); string n = obj.getAttribute().getAttribute().getAttribute(); // -------- if (!(n.Equals("hello"))) { Environment.Exit(-1); } if (!(obj.getAttribute().getAttribute().getAttribute().Equals("hello"))) { Environment.Exit(-1); } // -------- // * Indirect access Klass c = obj.getAttribute().getAttribute(); string m = c.getAttribute(); // -------- if (!(m.Equals("hello"))) { Environment.Exit(-1); } if (!(c.getAttribute().Equals("hello"))) { Environment.Exit(-1); } // -------- }
public static void testMultipleMethodCall() { Klass obj = new Klass(); obj.multipleMethodCall(); int n = obj.getAttribute().getAttribute().getAttribute(); // -------- Console.WriteLine(n); Console.WriteLine(obj.getAttribute().getAttribute().getAttribute()); // -------- // * Indirect access Klass c = obj.getAttribute().getAttribute(); int m = c.getAttribute(); // -------- Console.WriteLine(m); Console.WriteLine(c.getAttribute()); // -------- }