public static void TestAddAndRemovePackage( IntegrationTester.TestCase testCase, Action <IntegrationTester.TestCaseResult> testCaseComplete) { var testCaseResult = new IntegrationTester.TestCaseResult(testCase); const string packageToModify = "com.unity.ads"; PackageManagerClient.AddPackage( packageToModify, (result) => { if (UpmAvailable) { CheckChangeResult(result.Error, result.Package != null ? result.Package.Name : null, packageToModify, testCaseResult); } }); PackageManagerClient.RemovePackage( packageToModify, (result) => { var message = UpmAvailable ? CheckChangeResult(result.Error, result.PackageId, packageToModify, testCaseResult) : ""; if (testCaseResult.ErrorMessages.Count == 0) { UnityEngine.Debug.Log(message); } testCaseComplete(testCaseResult); }); }