public static bool StructNewObjTest() { Pair t1 = default(Pair); try { t1 = new Pair(5, 10); } catch { } return (t1.A == 5 && t1.B == 10); }
public static bool ForeachBreak() { LinkedList<Pair> PairList = new LinkedList<Pair>(); for (int i = 1; i < 10; i++) { Pair p = new Pair(10 * i, 20 * i); PairList.AddLast(p); } Pair found = FindPair(PairList); return (found.A == 90 && found.B == 180); }