Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-165.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6bfbfe4455998343c4624f98a8622a4906ce0ef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;   
   
public class Testing   
{   
        enum Fruit { Apple, Banana, Cherry };   

	static int TestEnumInit (Fruit f)
	{
		Fruit [] testedFruits = { f };

		if (f != Fruit.Apple)
			return 1;
		return 0;
	}

        public static int Main()   
        {   
                Fruit[] pieFillings = { Fruit.Apple, Fruit.Banana, Fruit.Cherry };

		if (pieFillings [0] != Fruit.Apple)
			return 1;
		if (pieFillings [1] != Fruit.Banana)
			return 2;
		if (pieFillings [2] != Fruit.Cherry)
			return 3;

		if (TestEnumInit (Fruit.Apple) != 0)
			return 4;

		return 0;
        }          
}