static int Beer (IrishPub? pub) { switch (pub) { case 0x1001: return 1; case 0x2002: return 2; default: return 3; } }
static int Main() { IrishPub pub = new IrishPub(IrishBeer.Guinness); if (PubToLong(pub) != 0x1001) { return(1); } if (Beer(null) != 3) { return(2); } if (Beer(new IrishPub(IrishBeer.Guinness)) != 1) { return(3); } if (Test(null) != 2) { return(4); } if (Test(3) != 1) { return(5); } if (Test(true) != 1) { return(6); } if (Test(false) != 2) { return(7); } if (TestWithNull(null) != 2) { return(8); } if (TestWithNull(3) != 1) { return(9); } return(0); }
static long PubToLong (IrishPub pub) { return pub; }
static int Main () { IrishPub pub = new IrishPub (IrishBeer.Guinness); if (PubToLong (pub) != 0x1001) return 1; if (Beer (null) != 3) return 2; if (Beer (new IrishPub (IrishBeer.Guinness)) != 1) return 3; if (Test (null) != 2) return 4; if (Test (3) != 1) return 5; if (Test (true) != 1) return 6; if (Test (false) != 2) return 7; if (TestWithNull (null) != 2) return 8; if (TestWithNull (3) != 1) return 9; return 0; }
static long PubToLong(IrishPub pub) { return(pub); }