TestChangesView.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System.Collections.Generic;
  2. using Unity.Cloud.Collaborate.Models.Structures;
  3. using Unity.Cloud.Collaborate.Presenters;
  4. using Unity.Cloud.Collaborate.Views;
  5. namespace Unity.Cloud.Collaborate.Tests.Presenters
  6. {
  7. internal class TestChangesView : IChangesView
  8. {
  9. public int SetBusyStatusCount;
  10. public bool? SetBusyStatusValue;
  11. public int SetSearchQueryCount;
  12. public string SetSearchQueryValue;
  13. public int SetRevisionSummaryCount;
  14. public string SetRevisionSummaryValue;
  15. public int SetConflictsCount;
  16. public IReadOnlyList<IChangeEntryData> SetConflictsValue;
  17. public int SetChangesCount;
  18. public IReadOnlyList<IChangeEntryData> SetChangesValue;
  19. public int SetToggledCountCount;
  20. public int? SetToggledCountValue;
  21. public int SetPublishEnabledCount;
  22. public bool? SetPublishEnabledValue;
  23. public string SetPublishEnabledReason;
  24. public int DisplayDialogueCount;
  25. public IChangesPresenter Presenter { get; set; }
  26. public void SetBusyStatus(bool busy)
  27. {
  28. SetBusyStatusCount++;
  29. SetBusyStatusValue = busy;
  30. }
  31. public void SetSearchQuery(string query)
  32. {
  33. SetSearchQueryCount++;
  34. SetSearchQueryValue = query;
  35. }
  36. public void SetRevisionSummary(string message)
  37. {
  38. SetRevisionSummaryCount++;
  39. SetRevisionSummaryValue = message;
  40. }
  41. public void SetConflicts(IReadOnlyList<IChangeEntryData> list)
  42. {
  43. SetConflictsCount++;
  44. SetConflictsValue = list;
  45. }
  46. public void SetChanges(IReadOnlyList<IChangeEntryData> list)
  47. {
  48. SetChangesCount++;
  49. SetChangesValue = list;
  50. }
  51. public void SetToggledCount(int count)
  52. {
  53. SetToggledCountCount++;
  54. SetToggledCountValue = count;
  55. }
  56. public void SetPublishEnabled(bool enabled, string reason = null)
  57. {
  58. SetPublishEnabledCount++;
  59. SetPublishEnabledValue = enabled;
  60. SetPublishEnabledReason = reason;
  61. }
  62. public bool DisplayDialogue(string title, string message, string affirmative)
  63. {
  64. DisplayDialogueCount++;
  65. return true;
  66. }
  67. public bool DisplayDialogue(string title, string message, string affirmative, string negative)
  68. {
  69. DisplayDialogueCount++;
  70. return true;
  71. }
  72. public void SetSelectedChanges()
  73. {
  74. }
  75. }
  76. }