[sdks] Fix README.md
[mono-project.git] / mcs / tests / gtest-247.cs
blobacd4b99e773f7a43cac588ae8654930c8fa63cc8
1 using System;
2 using System.Diagnostics;
3 using SCG = System.Collections.Generic;
5 public abstract class EnumerableBase<T> : SCG.IEnumerable<T>
7 public abstract SCG.IEnumerator<T> GetEnumerator ();
9 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
11 return GetEnumerator ();
15 public abstract class CollectionValueBase<T> : EnumerableBase<T>
17 protected virtual void raiseItemsAdded (T item, int count)
18 { }
20 protected class RaiseForRemoveAllHandler
22 CircularQueue<T> wasRemoved;
25 public override abstract SCG.IEnumerator<T> GetEnumerator();
28 public class CircularQueue<T> : EnumerableBase<T>
30 public override SCG.IEnumerator<T> GetEnumerator()
32 yield break;
35 public virtual void Enqueue (T item)
36 { }
39 public class HashSet<T> : CollectionValueBase<T>
41 private bool searchoradd (ref T item, bool add, bool update, bool raise)
43 return true;
46 public virtual void RemoveAll<U>(SCG.IEnumerable<U> items) where U : T
48 RaiseForRemoveAllHandler raiseHandler = new RaiseForRemoveAllHandler ();
51 public virtual void AddAll<U> (SCG.IEnumerable<U> items)
52 where U : T
54 CircularQueue<T> wasAdded = new CircularQueue<T> ();
56 foreach (T item in wasAdded)
57 raiseItemsAdded (item, 1);
60 public override SCG.IEnumerator<T> GetEnumerator()
62 yield break;
66 class X
68 public static void Main ()
69 { }