Recovering DefaultOrchardHost.Current for unit tests

This commit is contained in:
Sebastien Ros
2013-08-23 17:07:09 -07:00
parent a50e1b704d
commit b8f97cd0a7

View File

@@ -11,6 +11,7 @@ using Orchard.Environment.Descriptor;
using Orchard.Environment.Descriptor.Models;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.Utility.Extensions;
namespace Orchard.Environment {
public class DefaultOrchardHost : IOrchardHost, IShellSettingsManagerEventHandler, IShellDescriptorManagerEventHandler {
@@ -53,6 +54,10 @@ namespace Orchard.Environment {
public Localizer T { get; set; }
public ILogger Logger { get; set; }
public IList<ShellContext> Current {
get { return BuildCurrent().ToReadOnlyCollection(); }
}
public ShellContext GetShellContext(ShellSettings shellSettings) {
return BuildCurrent().SingleOrDefault(shellContext => shellContext.Settings.Name.Equals(shellSettings.Name));
}