fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public class Resource
  6. {
  7. public class Id
  8. {
  9. public static int map = 0;
  10. }
  11. }
  12. public class FakeFragmentManager
  13. {
  14. public static FakeMapFragment FindFragmentById(int id)
  15. {
  16. return new FakeMapFragment();
  17. }
  18. }
  19. public class FakeMapFragment
  20. {
  21. public void GetMapAsync(IOnMapReadyCallback OnMapReadyCallback)
  22. {
  23. OnMapReadyCallback.OnMapReady("fake map is ready");
  24. }
  25. }
  26. public interface IOnMapReadyCallback
  27. {
  28. void OnMapReady(string str);
  29. }
  30.  
  31. public class VeryNaiveImpl : IOnMapReadyCallback
  32. {
  33. public Action<string> Callback;
  34. public void OnMapReady(string map)
  35. {
  36. if(Callback!=null)
  37. Callback(map);
  38. }
  39. }
  40.  
  41. public static void Main()
  42. {
  43. var mapFragment = FakeFragmentManager.FindFragmentById(Resource.Id.map);
  44. mapFragment.GetMapAsync(new VeryNaiveImpl {
  45. Callback = (map) =>
  46. {
  47. Console.WriteLine(map);
  48. }});
  49. }
  50. }
Success #stdin #stdout 0.03s 24120KB
stdin
Standard input is empty
stdout
fake map is ready