Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-async-49.cs
1 using System;
2 using System.Linq;
3 using System.Collections.Generic;
4 using System.Threading.Tasks;
5
6 class TodoItem
7 {
8 }
9
10 internal class MobileServiceTable2<T>
11 {
12         public Task<List<T>> ToListAsync ()
13         {
14                 var r = new List<T> ();
15                 r.Add (default (T));
16                 return Task.FromResult<List<T>> (r);
17         }
18 }
19
20 public class Tests
21 {
22         int foo (Action t)
23         {
24                 t ();
25                 return 0;
26         }
27
28         private void OnTap (TodoItem task)
29         {
30         }
31
32         private async Task RefreshAsync ()
33         {
34                 var ta = new MobileServiceTable2<TodoItem> ();
35                 var r = await ta.ToListAsync ();
36
37                 r.Select<TodoItem, int> (t => foo (() => OnTap (t))).ToList ();
38         }
39
40         public static void Main (String[] args)
41         {
42                 var t = new Tests ();
43                 t.RefreshAsync ().Wait ();
44         }
45 }