mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Fixing unit tests
This commit is contained in:
parent
a0c61c0328
commit
2d4c87d1d7
@ -12,13 +12,18 @@ using Orchard.Environment.State;
|
||||
using Orchard.Environment.Descriptor;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
using Orchard.Events;
|
||||
using Orchard.Caching;
|
||||
using Orchard.Core.Settings.State.Records;
|
||||
|
||||
namespace Orchard.Tests.Modules.Settings.Blueprint {
|
||||
[TestFixture]
|
||||
public class ShellDescriptorManagerTests : DatabaseEnabledTestsBase {
|
||||
public override void Register(ContainerBuilder builder) {
|
||||
builder.RegisterInstance(new ShellSettings { Name = "Default" });
|
||||
|
||||
builder.RegisterModule(new CacheModule());
|
||||
builder.RegisterType<DefaultCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterType<DefaultCacheHolder>().As<ICacheHolder>().SingleInstance();
|
||||
builder.RegisterType<DefaultCacheContextAccessor>().As<ICacheContextAccessor>();
|
||||
builder.RegisterType<ShellDescriptorManager>().As<IShellDescriptorManager>().SingleInstance();
|
||||
builder.RegisterType<ShellStateManager>().As<IShellStateManager>().SingleInstance();
|
||||
builder.RegisterType<StubEventBus>().As<IEventBus>().SingleInstance();
|
||||
@ -39,6 +44,8 @@ namespace Orchard.Tests.Modules.Settings.Blueprint {
|
||||
protected override IEnumerable<Type> DatabaseTypes {
|
||||
get {
|
||||
return new[] {
|
||||
typeof (ShellStateRecord),
|
||||
typeof (ShellFeatureStateRecord),
|
||||
typeof (ShellDescriptorRecord),
|
||||
typeof (ShellFeatureRecord),
|
||||
typeof (ShellParameterRecord),
|
||||
|
@ -37,6 +37,8 @@ namespace Orchard.Tests.Environment.Loaders {
|
||||
builder.RegisterType<StubAppDataFolder>().As<IAppDataFolder>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
|
||||
builder.RegisterInstance(new ExtensionLocations());
|
||||
|
||||
_mockedStubProjectFileParser = new Mock<IProjectFileParser>();
|
||||
builder.RegisterInstance(_mockedStubProjectFileParser.Object).As<IProjectFileParser>();
|
||||
builder.RegisterInstance(new StubFileSystem(new StubClock())).As<StubFileSystem>();
|
||||
|
@ -53,9 +53,8 @@ namespace Orchard.Tokens.Implementation {
|
||||
var replacements = Evaluate(options.Predicate == null ? tokens : tokens.Where(options.Predicate), data);
|
||||
|
||||
return replacements.Aggregate(tokenset.Item1,
|
||||
(current, replacement) => replacement.Value == null ?
|
||||
current : current.Replace((hashMode ? "#{" : "{") + replacement.Key + "}",
|
||||
(options.Encoding ?? ReplaceOptions.NoEncode)(replacement.Key, replacement.Value)));
|
||||
(current, replacement) => current.Replace((hashMode ? "#{" : "{") + replacement.Key + "}",
|
||||
(options.Encoding ?? ReplaceOptions.NoEncode)(replacement.Key, replacement.Value ?? "")));
|
||||
}
|
||||
|
||||
private static Tuple<string, IEnumerable<string>> Parse(string text, bool hashMode) {
|
||||
|
Loading…
Reference in New Issue
Block a user