2017-07-20 11:21:28 +02:00
|
|
|
|
using System.Collections.Generic;
|
2015-01-16 15:47:44 +11:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
using Moq;
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
using Umbraco.Core.Cache;
|
2017-05-30 15:46:25 +02:00
|
|
|
|
using Umbraco.Core.Composing;
|
2015-01-16 15:47:44 +11:00
|
|
|
|
using Umbraco.Core.Logging;
|
|
|
|
|
|
|
2016-11-07 19:12:09 +01:00
|
|
|
|
namespace Umbraco.Tests.DI
|
2015-01-16 15:47:44 +11:00
|
|
|
|
{
|
2016-08-25 15:09:51 +02:00
|
|
|
|
public abstract class ResolverBaseTest // fixme rename, do something!
|
2015-01-16 15:47:44 +11:00
|
|
|
|
{
|
2017-05-30 15:33:13 +02:00
|
|
|
|
protected TypeLoader TypeLoader { get; private set; }
|
2015-01-16 15:47:44 +11:00
|
|
|
|
protected ProfilingLogger ProfilingLogger { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
ProfilingLogger = new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>());
|
|
|
|
|
|
|
2017-12-15 16:29:14 +01:00
|
|
|
|
TypeLoader = new TypeLoader(NullCacheProvider.Instance,
|
2015-01-16 15:47:44 +11:00
|
|
|
|
ProfilingLogger,
|
|
|
|
|
|
false)
|
|
|
|
|
|
{
|
|
|
|
|
|
AssembliesToScan = AssembliesToScan
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-08-07 16:45:41 +02:00
|
|
|
|
[TearDown]
|
|
|
|
|
|
public void TearDown()
|
|
|
|
|
|
{
|
2016-08-19 11:13:19 +02:00
|
|
|
|
Current.Reset();
|
2016-08-07 16:45:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-07-20 11:21:28 +02:00
|
|
|
|
protected virtual IEnumerable<Assembly> AssembliesToScan
|
|
|
|
|
|
=> new[]
|
2015-01-16 15:47:44 +11:00
|
|
|
|
{
|
2016-08-25 15:09:51 +02:00
|
|
|
|
GetType().Assembly // this assembly only
|
|
|
|
|
|
};
|
2015-01-16 15:47:44 +11:00
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|