コード例 #1
0
	static int Beer (IrishPub? pub)
	{
		switch (pub) {
		case 0x1001:
			return 1;

		case 0x2002:
			return 2;

		default:
			return 3;
		}
	}
コード例 #2
0
ファイル: gtest-269.cs プロジェクト: andyhebear/Csharp-Parser
    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);
    }
コード例 #3
0
	static long PubToLong (IrishPub pub)
	{
		return pub;
	}
コード例 #4
0
	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;
	}
コード例 #5
0
ファイル: gtest-269.cs プロジェクト: andyhebear/Csharp-Parser
 static long PubToLong(IrishPub pub)
 {
     return(pub);
 }