Fixes typefinder/loader dependency refs, allows config to specify additional entry assemblies

This commit is contained in:
Shannon
2021-07-09 16:15:37 -06:00
parent 7ec3afa5ff
commit f7b8a93a35
16 changed files with 127 additions and 87 deletions

View File

@@ -44,13 +44,13 @@ namespace Umbraco.Cms.Tests.Common
protected TestHelperBase(Assembly entryAssembly)
{
MainDom = new SimpleMainDom();
_typeFinder = new TypeFinder(NullLoggerFactory.Instance.CreateLogger<TypeFinder>(), new DefaultUmbracoAssemblyProvider(entryAssembly, NullLoggerFactory.Instance), new VaryingRuntimeHash());
_typeFinder = new TypeFinder(NullLoggerFactory.Instance.CreateLogger<TypeFinder>(), new DefaultUmbracoAssemblyProvider(entryAssembly, NullLoggerFactory.Instance));
}
public ITypeFinder GetTypeFinder() => _typeFinder;
public TypeLoader GetMockedTypeLoader() =>
new TypeLoader(Mock.Of<ITypeFinder>(), Mock.Of<IAppPolicyCache>(), new DirectoryInfo(GetHostingEnvironment().MapPathContentRoot(Constants.SystemDirectories.TempData)), Mock.Of<ILogger<TypeLoader>>(), Mock.Of<IProfiler>());
new TypeLoader(Mock.Of<ITypeFinder>(), new VaryingRuntimeHash(), Mock.Of<IAppPolicyCache>(), new DirectoryInfo(GetHostingEnvironment().MapPathContentRoot(Constants.SystemDirectories.TempData)), Mock.Of<ILogger<TypeLoader>>(), Mock.Of<IProfiler>());
//// public Configs GetConfigs() => GetConfigsFactory().Create();