MockOperation.cs 859 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace UnityEditor.PackageManager.UI.Tests
  3. {
  4. internal class MockOperation : IBaseOperation
  5. {
  6. public event Action<Error> OnOperationError { add { } remove { } }
  7. public event Action OnOperationFinalized { add { } remove { } }
  8. public event Action<string> OnOperationFailure { add { } remove { } }
  9. public bool IsCompleted { get; protected set; }
  10. public bool RequireNetwork { get; set; }
  11. public Error ForceError { protected get; set; } // Allow external component to force an error on the requests (eg: testing)
  12. protected readonly MockOperationFactory Factory;
  13. protected MockOperation(MockOperationFactory factory)
  14. {
  15. RequireNetwork = false;
  16. Factory = factory;
  17. }
  18. public void Cancel()
  19. {
  20. }
  21. }
  22. }