Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-iter-07.cs
1 using System;
2 using System.Collections.Generic;
3
4 public class Test
5 {
6         public static int Main ()
7         {
8                 MySystem mySystem = new MySystem ();
9                 return 0;
10         }
11
12         public static void TestFunction (IEnumerable<string> items)
13         {
14                 List<string> newList;
15                 Console.WriteLine ("1");
16                 newList = new List<string> (items);
17                 Console.WriteLine ("2");
18                 newList = new List<string> (items);
19         }
20 }
21
22 public class MySystem
23 {
24         private List<string> _items = new List<string> ();
25
26         public MySystem ()
27         {
28                 _items.Add ("a");
29         }
30
31         public IEnumerable<string> Items
32         {
33                 get
34                 {
35                         foreach (string i in _items) {
36                                 Console.WriteLine (i);
37                                 yield return i;
38                         }
39                 }
40         }
41 }