Game/Library/PackageCache/com.unity.package-manager-ui@2.0.13/Tests/Editor/Services/Mock/MockOperation.cs
2021-01-16 18:29:12 +01:00

28 lines
859 B
C#

using System;
namespace UnityEditor.PackageManager.UI.Tests
{
internal class MockOperation : IBaseOperation
{
public event Action<Error> OnOperationError { add { } remove { } }
public event Action OnOperationFinalized { add { } remove { } }
public event Action<string> OnOperationFailure { add { } remove { } }
public bool IsCompleted { get; protected set; }
public bool RequireNetwork { get; set; }
public Error ForceError { protected get; set; } // Allow external component to force an error on the requests (eg: testing)
protected readonly MockOperationFactory Factory;
protected MockOperation(MockOperationFactory factory)
{
RequireNetwork = false;
Factory = factory;
}
public void Cancel()
{
}
}
}