#20905: Fixing unit tests

Work Item: 20905
This commit is contained in:
Sebastien Ros
2014-08-27 10:35:42 -07:00
parent 5f92beb0fb
commit 7b565c0517

View File

@@ -31,7 +31,7 @@ namespace Orchard.ContentManagement {
private readonly IRepository<ContentItemVersionRecord> _contentItemVersionRepository;
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly ICacheManager _cacheManager;
private readonly Lazy<IContentManagerSession> _contentManagerSession;
private readonly Func<IContentManagerSession> _contentManagerSession;
private readonly Lazy<IContentDisplay> _contentDisplay;
private readonly Lazy<ISessionLocator> _sessionLocator;
private readonly Lazy<IEnumerable<IContentHandler>> _handlers;
@@ -50,7 +50,7 @@ namespace Orchard.ContentManagement {
IRepository<ContentItemVersionRecord> contentItemVersionRepository,
IContentDefinitionManager contentDefinitionManager,
ICacheManager cacheManager,
Lazy<IContentManagerSession> contentManagerSession,
Func<IContentManagerSession> contentManagerSession,
Lazy<IContentDisplay> contentDisplay,
Lazy<ISessionLocator> sessionLocator,
Lazy<IEnumerable<IContentHandler>> handlers,
@@ -132,7 +132,7 @@ namespace Orchard.ContentManagement {
}
public virtual ContentItem Get(int id, VersionOptions options, QueryHints hints) {
var session = _contentManagerSession.Value;
var session = _contentManagerSession();
ContentItem contentItem;
ContentItemVersionRecord versionRecord = null;
@@ -651,7 +651,7 @@ namespace Orchard.ContentManagement {
public void Clear() {
var session = _sessionLocator.Value.For(typeof(ContentItemRecord));
session.Clear();
_contentManagerSession.Value.Clear();
_contentManagerSession().Clear();
}
public IContentQuery<ContentItem> Query() {