Files
Umbraco-CMS/src/Umbraco.Tests/Composing/ComposingTestBase.cs

44 lines
1.2 KiB
C#
Raw Normal View History

2017-07-20 11:21:28 +02:00
using System.Collections.Generic;
2019-11-11 18:56:14 +11:00
using System.IO;
using System.Reflection;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Cache;
2017-05-30 15:46:25 +02:00
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
2019-02-15 08:46:57 +01:00
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Tests.TestHelpers;
2018-02-02 19:43:03 +01:00
namespace Umbraco.Tests.Composing
{
2018-02-02 19:43:03 +01:00
public abstract class ComposingTestBase
{
2017-05-30 15:33:13 +02:00
protected TypeLoader TypeLoader { get; private set; }
2018-02-02 19:43:03 +01:00
2018-11-27 13:46:43 +01:00
protected IProfilingLogger ProfilingLogger { get; private set; }
[SetUp]
public void Initialize()
{
ProfilingLogger = new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>());
var typeFinder = new TypeFinder(Mock.Of<ILogger>());
2019-11-11 18:56:14 +11:00
var ioHelper = IOHelper.Default;
TypeLoader = new TypeLoader(ioHelper, typeFinder, NoAppCache.Instance, new DirectoryInfo(ioHelper.MapPath("~/App_Data/TEMP")), ProfilingLogger, false, 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[]
{
2016-08-25 15:09:51 +02:00
GetType().Assembly // this assembly only
};
}
2017-07-20 11:21:28 +02:00
}