Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.VisualStudio.TestTools.UnitTesting;
  4. using MvvmCross.Core.ViewModels;
  5. using MvvmCross.Core.Views;
  6. using MvvmCross.Platform.Core;
  7.  
  8. namespace PokeApp.Tests
  9. {
  10. public class MockDispatcher
  11. : MvxMainThreadDispatcher
  12. , IMvxViewDispatcher
  13. {
  14. public readonly List<MvxViewModelRequest> Requests = new List<MvxViewModelRequest>();
  15. public readonly List<MvxPresentationHint> Hints = new List<MvxPresentationHint>();
  16.  
  17. public bool RequestMainThreadAction(Action action)
  18. {
  19. action();
  20. return true;
  21. }
  22.  
  23. public bool ShowViewModel(MvxViewModelRequest request)
  24. {
  25. Requests.Add(request);
  26. return true;
  27. }
  28.  
  29. public bool ChangePresentation(MvxPresentationHint hint)
  30. {
  31. Hints.Add(hint);
  32. return true;
  33. }
  34.  
  35. public bool RequestMainThreadAction(Action action, bool maskExceptions = true)
  36. {
  37. throw new NotImplementedException();
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement