mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing some issues that showed up in testing
Built-in zones need to be created with names Binding and shape dictionary is now compare-ordinal-case-insensive ZoneName is quirky - because it is an actual property some of the inline assignment mechanisms don't work as expected. Main content area is salmon --HG-- branch : dev
This commit is contained in:
@@ -18,8 +18,8 @@ namespace Orchard.Tests.DisplayManagement {
|
||||
|
||||
protected override void Register(Autofac.ContainerBuilder builder) {
|
||||
_defaultShapeTable = new ShapeTable {
|
||||
Descriptors = new Dictionary<string, ShapeDescriptor>(),
|
||||
Bindings = new Dictionary<string, ShapeBinding>()
|
||||
Descriptors = new Dictionary<string, ShapeDescriptor>(StringComparer.OrdinalIgnoreCase),
|
||||
Bindings = new Dictionary<string, ShapeBinding>(StringComparer.OrdinalIgnoreCase)
|
||||
};
|
||||
_workContext = new TestWorkContext {
|
||||
CurrentTheme = new Theme { ThemeName = "Hello" }
|
||||
@@ -322,5 +322,26 @@ namespace Orchard.Tests.DisplayManagement {
|
||||
Assert.That(resultNormally.ToString(), Is.EqualTo("alpha"));
|
||||
Assert.That(resultWithOverride.ToString(), Is.EqualTo("beta"));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ShapeTypeAndBindingNamesAreNotCaseSensitive() {
|
||||
var displayManager = _container.Resolve<IDisplayManager>();
|
||||
|
||||
var shapeFoo = new Shape {
|
||||
Metadata = new ShapeMetadata {
|
||||
Type = "foo"
|
||||
}
|
||||
};
|
||||
var descriptorFoo = new ShapeDescriptor {
|
||||
ShapeType = "Foo",
|
||||
};
|
||||
AddBinding(descriptorFoo, "Foo", ctx => new HtmlString("alpha"));
|
||||
AddShapeDescriptor(descriptorFoo);
|
||||
|
||||
var result = displayManager.Execute(CreateDisplayContext(shapeFoo));
|
||||
|
||||
Assert.That(result.ToString(), Is.EqualTo("alpha"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user