2020-12-20 08:36:11 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
2020-12-08 10:42:26 +11:00
|
|
|
using System.Collections.Generic;
|
2019-11-11 18:56:14 +11:00
|
|
|
using System.IO;
|
2015-01-16 15:47:44 +11:00
|
|
|
using System.Reflection;
|
2020-09-28 14:59:17 +02:00
|
|
|
using Microsoft.Extensions.Logging;
|
2015-01-16 15:47:44 +11:00
|
|
|
using Moq;
|
|
|
|
|
using NUnit.Framework;
|
2022-06-21 08:09:38 +02:00
|
|
|
using Umbraco.Cms.Core;
|
2021-02-18 11:06:02 +01:00
|
|
|
using Umbraco.Cms.Core.Cache;
|
|
|
|
|
using Umbraco.Cms.Core.Composing;
|
|
|
|
|
using Umbraco.Cms.Core.Logging;
|
|
|
|
|
using Umbraco.Cms.Tests.UnitTests.TestHelpers;
|
2015-01-16 15:47:44 +11:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Composing;
|
|
|
|
|
|
|
|
|
|
public abstract class ComposingTestBase
|
2015-01-16 15:47:44 +11:00
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
protected TypeLoader TypeLoader { get; private set; }
|
2018-02-02 19:43:03 +01:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
protected virtual IEnumerable<Assembly> AssembliesToScan
|
|
|
|
|
=> new[]
|
2015-01-16 15:47:44 +11:00
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
GetType().Assembly, // this assembly only
|
|
|
|
|
};
|
2020-10-26 13:34:08 +01:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
[SetUp]
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
var typeFinder = TestHelper.GetTypeFinder();
|
|
|
|
|
TypeLoader = new TypeLoader(
|
|
|
|
|
typeFinder,
|
|
|
|
|
Mock.Of<ILogger<TypeLoader>>(),
|
|
|
|
|
AssembliesToScan);
|
2015-01-16 15:47:44 +11:00
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
}
|