Preparing PackageExpander unit tests

--HG--
branch : nuget
This commit is contained in:
Sebastien Ros
2010-11-08 13:21:06 -08:00
parent 70848ef2dd
commit 77cc446f99
9 changed files with 82 additions and 5 deletions

View File

@@ -54,12 +54,23 @@ namespace Orchard.Packaging.Commands {
Context.Output.WriteLine(T("File \"{0}\" does not exist.", filename));
}
var packageInfo = _packageManager.Install(filename, GetSolutionFolder());
var solutionFolder = GetSolutionFolder();
if(solutionFolder == null) {
Context.Output.WriteLine(T("The project's location is not supported"));
}
var packageInfo = _packageManager.Install(filename, solutionFolder);
Context.Output.WriteLine(T("Package \"{0}\" successfully installed at \"{1}\"", packageInfo.ExtensionName, packageInfo.ExtensionPath));
}
private string GetSolutionFolder() {
return Directory.GetParent(OrchardWebProj).Parent.FullName;
private static string GetSolutionFolder() {
var orchardDirectory = Directory.GetParent(OrchardWebProj);
if(orchardDirectory.Parent == null) {
return null;
}
return orchardDirectory.Parent.FullName;
}
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.IO;
namespace Orchard.Packaging.Services {
@@ -7,5 +8,6 @@ namespace Orchard.Packaging.Services {
void Push(PackageData packageData, string feedUrl, string login, string password);
PackageInfo Install(string filename, string destination);
PackageInfo Install(Uri uri, string destination);
}
}

View File

@@ -93,6 +93,11 @@ namespace Orchard.Packaging.Services {
return _packageExpander.ExpandPackage(packageId, version, location, destination);
}
public PackageInfo Install(Uri uri, string destination) {
return null;
}
#endregion
}
}