mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Rough intermediate state
display and shape are a work in progress coarse grained service interfaces and relationships forming --HG-- branch : mvc3p1
This commit is contained in:
37
src/Orchard.Tests/DisplayManagement/ShapeFactoryTests.cs
Normal file
37
src/Orchard.Tests/DisplayManagement/ShapeFactoryTests.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autofac;
|
||||
using NUnit.Framework;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.DisplayManagement.Shapes;
|
||||
|
||||
namespace Orchard.Tests.DisplayManagement {
|
||||
[TestFixture]
|
||||
public class DefaultShapeBuilderTests {
|
||||
private IContainer _container;
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<DefaultShapeBuilder>().As<IShapeBuilder>();
|
||||
_container = builder.Build();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ShapeHasAttributesType() {
|
||||
var factory = _container.Resolve<IShapeBuilder>();
|
||||
dynamic foo = factory.Build("Foo", ArgsUtility.Empty());
|
||||
ShapeAttributes attributes = foo.Attributes;
|
||||
Assert.That(attributes.Type, Is.EqualTo("Foo"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateShapeWithNamedArguments() {
|
||||
var factory = _container.Resolve<IShapeBuilder>();
|
||||
var foo = factory.Build("Foo", ArgsUtility.Named(new { one = 1, two = "dos" }));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user