You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.4 KiB
36 lines
1.4 KiB
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) |
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) |
|
|
|
using System; |
|
using System.Collections.Generic; |
|
using ICSharpCode.PackageManagement; |
|
using ICSharpCode.PackageManagement.Design; |
|
using NuGet; |
|
|
|
namespace PackageManagement.Tests.Helpers |
|
{ |
|
public class ExceptionThrowingPackageManagementProject : FakePackageManagementProject |
|
{ |
|
public Exception ExceptionToThrowWhenCreateInstallPackageActionCalled { get; set; } |
|
public Exception ExceptionToThrowWhenCreateUninstallPackageActionCalled { get; set; } |
|
public Exception ExceptionToThrowWhenGetInstallPackageOperationsCalled { get; set; } |
|
|
|
public override InstallPackageAction CreateInstallPackageAction() |
|
{ |
|
throw ExceptionToThrowWhenCreateInstallPackageActionCalled; |
|
} |
|
|
|
public override UninstallPackageAction CreateUninstallPackageAction() |
|
{ |
|
throw ExceptionToThrowWhenCreateUninstallPackageActionCalled; |
|
} |
|
|
|
public override IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions) |
|
{ |
|
if (ExceptionToThrowWhenGetInstallPackageOperationsCalled != null) { |
|
throw ExceptionToThrowWhenGetInstallPackageOperationsCalled; |
|
} |
|
return base.GetInstallPackageOperations(package, ignoreDependencies, allowPrereleaseVersions); |
|
} |
|
} |
|
}
|
|
|