28 changed files with 472 additions and 73 deletions
|
After Width: | Height: | Size: 701 B |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.PackageManagement |
||||
{ |
||||
public interface IMessageReporter |
||||
{ |
||||
void ShowErrorMessage(string message); |
||||
void ClearMessage(); |
||||
} |
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// 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.Design; |
||||
using NuGet; |
||||
|
||||
namespace PackageManagement.Tests.Helpers |
||||
{ |
||||
public class ExceptionThrowingPackageManagementService : FakePackageManagementService |
||||
{ |
||||
public Exception ExeptionToThrowWhenActiveProjectManagerAccessed { get; set; } |
||||
public Exception ExeptionToThrowWhenInstallPackageCalled { get; set; } |
||||
public Exception ExeptionToThrowWhenUninstallPackageCalled { get; set; } |
||||
|
||||
public override IProjectManager ActiveProjectManager { |
||||
get { |
||||
if (ExeptionToThrowWhenActiveProjectManagerAccessed != null) { |
||||
throw ExeptionToThrowWhenActiveProjectManagerAccessed; |
||||
} |
||||
return base.ActiveProjectManager; |
||||
} |
||||
} |
||||
|
||||
public override void InstallPackage(IPackageRepository repository, IPackage package, IEnumerable<PackageOperation> operations) |
||||
{ |
||||
throw ExeptionToThrowWhenInstallPackageCalled; |
||||
} |
||||
|
||||
public override void UninstallPackage(IPackageRepository repository, IPackage package) |
||||
{ |
||||
throw ExeptionToThrowWhenUninstallPackageCalled; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
// 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 NuGet; |
||||
|
||||
namespace PackageManagement.Tests.Helpers |
||||
{ |
||||
public class ExceptionThrowingPackageOperationResolver : FakePackageOperationResolver |
||||
{ |
||||
public Exception ResolveOperationsExceptionToThrow; |
||||
|
||||
public override IEnumerable<PackageOperation> ResolveOperations(IPackage package) |
||||
{ |
||||
throw ResolveOperationsExceptionToThrow; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
// 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 ICSharpCode.PackageManagement; |
||||
|
||||
namespace PackageManagement.Tests.Helpers |
||||
{ |
||||
public class FakeMessageReporter : IMessageReporter |
||||
{ |
||||
public string MessagePassedToShowErrorMessage; |
||||
public bool IsClearMessageCalled; |
||||
|
||||
public void ShowErrorMessage(string message) |
||||
{ |
||||
MessagePassedToShowErrorMessage = message; |
||||
} |
||||
|
||||
public void ClearMessage() |
||||
{ |
||||
IsClearMessageCalled = true; |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue