do not check order sequence if option /order was not used
[mono.git] / mcs / tests / gtest-339.cs
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4
5 class Program
6 {
7         static void Main ()
8         {
9                 SerializeDictionary (new SerializerLazyDictionary ());
10         }
11
12         static void SerializeDictionary (IDictionary values)
13         {
14         }
15
16         static void SerializeDictionary (IDictionary<string, object> values)
17         {
18         }
19 }
20
21 sealed class SerializerLazyDictionary : LazyDictionary
22 {
23         protected override IEnumerator<KeyValuePair<string, object>> GetEnumerator ()
24         {
25                 return null;
26         }
27 }
28
29 internal abstract class LazyDictionary : IDictionary<string, object>
30 {
31         void IDictionary<string, object>.Add (string key, object value)
32         {
33                 throw new NotSupportedException ();
34         }
35
36         bool IDictionary<string, object>.ContainsKey (string key)
37         {
38                 throw new NotSupportedException ();
39         }
40
41         ICollection<string> IDictionary<string, object>.Keys
42         {
43                 get { throw new NotSupportedException (); }
44         }
45
46         bool IDictionary<string, object>.Remove (string key)
47         {
48                 throw new NotSupportedException ();
49         }
50
51         bool IDictionary<string, object>.TryGetValue (string key, out object value)
52         {
53                 throw new NotSupportedException ();
54         }
55
56         ICollection<object> IDictionary<string, object>.Values
57         {
58                 get { throw new NotSupportedException (); }
59         }
60
61         object IDictionary<string, object>.this [string key] {
62                 get {
63                         throw new NotSupportedException ();
64                 }
65                 set {
66                         throw new NotSupportedException ();
67                 }
68         }
69
70         void ICollection<KeyValuePair<string, object>>.Add (KeyValuePair<string, object> item)
71         {
72                 throw new NotSupportedException ();
73         }
74
75         void ICollection<KeyValuePair<string, object>>.Clear ()
76         {
77                 throw new NotSupportedException ();
78         }
79
80         bool ICollection<KeyValuePair<string, object>>.Contains (KeyValuePair<string, object> item)
81         {
82                 throw new NotSupportedException ();
83         }
84
85         void ICollection<KeyValuePair<string, object>>.CopyTo (KeyValuePair<string, object> [] array, int arrayIndex)
86         {
87                 throw new NotSupportedException ();
88         }
89
90         int ICollection<KeyValuePair<string, object>>.Count
91         {
92                 get { throw new NotSupportedException (); }
93         }
94
95         bool ICollection<KeyValuePair<string, object>>.IsReadOnly
96         {
97                 get { throw new NotSupportedException (); }
98         }
99
100         bool ICollection<KeyValuePair<string, object>>.Remove (KeyValuePair<string, object> item)
101         {
102                 throw new NotSupportedException ();
103         }
104
105         IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator ()
106         {
107                 return GetEnumerator ();
108         }
109
110         protected abstract IEnumerator<KeyValuePair<string, object>> GetEnumerator ();
111
112         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
113         {
114                 return ((IEnumerable<KeyValuePair<string, object>>) this).GetEnumerator ();
115         }
116 }