7 changed files with 99 additions and 0 deletions
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
// 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 Microsoft.VisualStudio.ExtensionManager |
||||
{ |
||||
public class NotInstalledException : Exception |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
// 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 Microsoft.VisualStudio.ExtensionManager; |
||||
|
||||
namespace Microsoft.VisualStudio.Shell |
||||
{ |
||||
public abstract class Package |
||||
{ |
||||
public static object GetGlobalService(Type serviceType) |
||||
{ |
||||
return new SVsExtensionManager(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
// 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 Microsoft.VisualStudio.ExtensionManager |
||||
{ |
||||
public class SVsExtensionManager |
||||
{ |
||||
public object GetInstalledExtension(string identifier) |
||||
{ |
||||
throw new NotInstalledException(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
// 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 Microsoft.VisualStudio.ExtensionManager; |
||||
using Microsoft.VisualStudio.Shell; |
||||
using NUnit.Framework; |
||||
|
||||
namespace PackageManagement.Tests.VisualStudio |
||||
{ |
||||
[TestFixture] |
||||
public class PackageTests |
||||
{ |
||||
[Test] |
||||
public void GetGlobalService_GetExtensionManagerService_ReturnsExtensionManager() |
||||
{ |
||||
object extensionManager = Package.GetGlobalService(typeof(SVsExtensionManager)) as SVsExtensionManager; |
||||
|
||||
Assert.IsInstanceOf(typeof(SVsExtensionManager), extensionManager); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
// 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 Microsoft.VisualStudio.ExtensionManager; |
||||
using NUnit.Framework; |
||||
|
||||
namespace PackageManagement.Tests.VisualStudio |
||||
{ |
||||
[TestFixture] |
||||
public class SVsExtensionManagerTests |
||||
{ |
||||
SVsExtensionManager extensionManager; |
||||
|
||||
void CreateExtensionManager() |
||||
{ |
||||
extensionManager = new SVsExtensionManager(); |
||||
} |
||||
|
||||
[Test] |
||||
public void GetInstalledExtension_UnknownExtensionIdPassed_ThrowsNotInstalledException() |
||||
{ |
||||
CreateExtensionManager(); |
||||
|
||||
Assert.Throws<NotInstalledException>(() => extensionManager.GetInstalledExtension("UnknownExtensionId")); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue