public static bool testMethod() { OperatorsTestClass13 Test1 = new OperatorsTestClass13(); OperatorsTestClass13 Test2 = new OperatorsTestClass13(); Test2.intI = 3; OperatorsTestClass13 Test = Test1 + Test2; if (Test.intI == 5) { return true; } else { return false; } }
public static OperatorsTestClass13 operator +(OperatorsTestClass13 MyInt, OperatorsTestClass13 MyInt2) { OperatorsTestClass13 MC = new OperatorsTestClass13(); MC.intI = MyInt.intI + MyInt2.intI; return MC; }