--HG--
branch : net40
This commit is contained in:
Renaud Paquay
2010-05-21 21:53:00 -07:00
271 changed files with 11089 additions and 7795 deletions

View File

@@ -15,14 +15,17 @@ namespace Orchard.Tests.Modules.Settings.Topology {
public override void Register(ContainerBuilder builder) {
builder.RegisterType<ShellDescriptorManager>().As<IShellDescriptorManager>();
builder.RegisterType<StubEventBus>().As<IEventBus>().SingleInstance();
builder.RegisterSource(new EventsRegistrationSource());
}
public class StubEventBus : IEventBus {
public string LastMessageName { get; set; }
public IDictionary<string, string> LastEventData { get; set; }
public IDictionary<string, object> LastEventData { get; set; }
public void Notify(string messageName, IDictionary<string, string> eventData) {
public void Notify_Obsolete(string messageName, IDictionary<string, string> eventData) {
}
public void Notify(string messageName, Dictionary<string, object> eventData) {
LastMessageName = messageName;
LastEventData = eventData;
}
@@ -137,7 +140,7 @@ namespace Orchard.Tests.Modules.Settings.Topology {
Enumerable.Empty<ShellFeature>(),
Enumerable.Empty<ShellParameter>());
Assert.That(eventBus.LastMessageName, Is.EqualTo("ShellDescriptor_Changed"));
Assert.That(eventBus.LastMessageName, Is.EqualTo("IShellDescriptorManagerEventHandler.Changed"));
}
}
}

View File

@@ -6,6 +6,7 @@ using System.Web.Routing;
using Autofac;
using Moq;
using NUnit.Framework;
using Orchard.ContentManagement.MetaData.Records;
using Orchard.Data;
using Orchard.Environment;
using Orchard.ContentManagement;
@@ -30,6 +31,7 @@ namespace Orchard.Tests.Modules.Users.Controllers {
public override void Register(ContainerBuilder builder) {
builder.RegisterType<AdminController>().SingleInstance();
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<DefaultContentQuery>().As<IContentQuery>().InstancePerDependency();
builder.RegisterType<MembershipService>().As<IMembershipService>();
builder.RegisterType<UserService>().As<IUserService>();
@@ -43,7 +45,13 @@ namespace Orchard.Tests.Modules.Users.Controllers {
protected override IEnumerable<Type> DatabaseTypes {
get {
return new[] { typeof(UserRecord), typeof(ContentItemRecord), typeof(ContentItemVersionRecord), typeof(ContentTypeRecord) };
return new[] { typeof(UserRecord),
typeof(ContentTypeRecord),
typeof(ContentTypePartRecord),
typeof(ContentTypePartNameRecord),
typeof(ContentItemRecord),
typeof(ContentItemVersionRecord),
};
}
}

View File

@@ -3,6 +3,7 @@ using System.Web.Security;
using Autofac;
using NHibernate;
using NUnit.Framework;
using Orchard.ContentManagement.MetaData.Records;
using Orchard.Data;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
@@ -41,7 +42,9 @@ namespace Orchard.Tests.Modules.Users.Services {
typeof(UserRecord),
typeof(ContentItemVersionRecord),
typeof(ContentItemRecord),
typeof(ContentTypeRecord));
typeof(ContentTypeRecord),
typeof(ContentTypePartRecord),
typeof(ContentTypePartNameRecord));
}
[TestFixtureTearDown]
@@ -55,6 +58,7 @@ namespace Orchard.Tests.Modules.Users.Services {
//builder.RegisterModule(new ImplicitCollectionSupportModule());
builder.RegisterType<MembershipService>().As<IMembershipService>();
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<UserHandler>().As<IContentHandler>();
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
_session = _sessionFactory.OpenSession();