public static int Main1() { Program0 p = new Program0(); Test30 t1Res = p.test1(); Console.WriteLine("test1 Result: {0}", t1Res.i1 + t1Res.i2); if ((t1Res.i1 + t1Res.i2) != 3) { throw new Exception("Failed test1 test!"); } Test31 t2Res = p.test2(); Console.WriteLine("test2 Result: {0}", t2Res.foo1.iFoo); if (t2Res.foo1.iFoo != 3) { throw new Exception("Failed test2 test!"); } Test32 t3Res = p.test3(); Console.WriteLine("test3 Result: {0}", t3Res.i1 + t3Res.foo1.iFoo); if ((t3Res.i1 + t3Res.foo1.iFoo) != 7) // Adding HashCodes should be != 0. { throw new Exception("Failed test3 test!"); } Test33 t4Res = p.test4(); Console.WriteLine("test4 Result: {0}", t4Res.foo1.iFoo + t4Res.foo2.iFoo); if ((t4Res.foo1.iFoo + t4Res.foo2.iFoo) != 11) { throw new Exception("Failed test4 test!"); } Test34 test5 = default(Test34); test5.i1 = 10; test5.i2 = 11; test5.f1 = 12; Test34 t5Res = p.test5(test5); Console.WriteLine("test5 Result: {0}", t5Res.i1 + t5Res.i2 + t5Res.f1); if ((t5Res.i1 + t5Res.i2 + t5Res.f1) != 42.0) { throw new Exception("Failed test5 test!"); } return(100); }
Test34 test5(Test34 t5) { float fRes = t5.i1 + t5.i2 + t5.f1; Console.WriteLine("From Test5 members: {0} {1} {2} {3}", t5.i1, t5.i2, t5.f1, fRes); Console.WriteLine("From Test5: Res {0}", fRes); if (fRes != 33.0) { throw new Exception("Failed inside test5 test!"); } Test34 tst5 = default(Test34); tst5.i1 = 13; tst5.i2 = 14; tst5.f1 = 15; return(tst5); }
Test34 test5(Test34 t5) { float fRes = t5.i1 + t5.i2 + t5.f1; Console.WriteLine("From Test5 members: {0} {1} {2} {3}", t5.i1, t5.i2, t5.f1, fRes); Console.WriteLine("From Test5: Res {0}", fRes); if (fRes != 33.0) { throw new Exception("Failed inside test5 test!"); } Test34 tst5 = default(Test34); tst5.i1 = 13; tst5.i2 = 14; tst5.f1 = 15; return tst5; }